Polish ActiveDirectoryLdapAuthenticationProviderTests
This commit polishes ActiveDirectoryLdapAuthenticationProviderTests.contextEnvironmentPropertiesUsed() by: - Adding fail() to prevent from going through an unexpected path. - Asserting that the root cause is an instance of ClassNotFoundException as the current code doesn't seem to right.
This commit is contained in:
parent
f5ad4ba0fa
commit
88181c31f1
|
@ -412,9 +412,10 @@ public class ActiveDirectoryLdapAuthenticationProviderTests {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
provider.authenticate(joe);
|
provider.authenticate(joe);
|
||||||
|
fail("CommunicationException was expected with a root cause of ClassNotFoundException");
|
||||||
}
|
}
|
||||||
catch (org.springframework.ldap.CommunicationException expected) {
|
catch (org.springframework.ldap.CommunicationException expected) {
|
||||||
assertThat(expected.getCause()).isNotInstanceOf(ClassNotFoundException.class);
|
assertThat(expected.getRootCause()).isInstanceOf(ClassNotFoundException.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue