You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Stefan Seelmann <ma...@stefan-seelmann.de> on 2015/01/21 19:45:01 UTC
Re: [1/2] directory-kerberos git commit: DIRKRB-119 Enhance KrbClient
to respect krb5.conf file. Contributed by Lin Chen
> + Assert.assertEquals(krbConfig.getDefaultTgsEnctypes().size(), 1);
> + Assert.assertEquals(krbConfig.getDefaultTgsEnctypes().get(0), EncryptionType.DES_CBC_CRC);
> +
> + Assert.assertEquals(krbConfig.getDefaultLoggingLocation(), "FILE:/var/log/krb5libs.log");
Just a minor note: The signature of assertEquals is
assertEquals(Object expected, Object actual)
So the arguments should be swapped.
Having said that, maybe we should consider to use a more advanced test
library, like AssertJ which provides a nice fluent interface, The above
would look like this:
assertThat(krbConfig.getDefaultTgsEnctypes())
.hasSize(1)
.contains(EncryptionType.DES_CBC_CRC);
assertThat(krbConfig.getDefaultLoggingLocation())
.isEqualTo("FILE:/var/log/krb5libs.log");
Kind Regards,
Stefan
RE: [1/2] directory-kerberos git commit: DIRKRB-119 Enhance
KrbClient to respect krb5.conf file. Contributed by Lin Chen
Posted by "Zheng, Kai" <ka...@intel.com>.
Good catch Stefan ! Thanks for your suggestion, it's good to look at AssertJ or else.
Lin, would you fire a JIRA to address this (possibly other places) ? Thanks.
Regards,
Kai
-----Original Message-----
From: Stefan Seelmann [mailto:mail@stefan-seelmann.de]
Sent: Thursday, January 22, 2015 2:45 AM
To: dev@directory.apache.org
Subject: Re: [1/2] directory-kerberos git commit: DIRKRB-119 Enhance KrbClient to respect krb5.conf file. Contributed by Lin Chen
> + Assert.assertEquals(krbConfig.getDefaultTgsEnctypes().size(), 1);
> + Assert.assertEquals(krbConfig.getDefaultTgsEnctypes().get(0),
> + EncryptionType.DES_CBC_CRC);
> +
> + Assert.assertEquals(krbConfig.getDefaultLoggingLocation(),
> + "FILE:/var/log/krb5libs.log");
Just a minor note: The signature of assertEquals is
assertEquals(Object expected, Object actual)
So the arguments should be swapped.
Having said that, maybe we should consider to use a more advanced test library, like AssertJ which provides a nice fluent interface, The above would look like this:
assertThat(krbConfig.getDefaultTgsEnctypes())
.hasSize(1)
.contains(EncryptionType.DES_CBC_CRC);
assertThat(krbConfig.getDefaultLoggingLocation())
.isEqualTo("FILE:/var/log/krb5libs.log");
Kind Regards,
Stefan