directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zheng, Kai" <kai.zh...@intel.com>
Subject RE: [1/2] directory-kerberos git commit: DIRKRB-119 Enhance KrbClient to respect krb5.conf file. Contributed by Lin Chen
Date Thu, 22 Jan 2015 00:40:47 GMT
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


Mime
View raw message