Browse Source

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.
pull/5739/head
Johnny Lim 7 years ago committed by Rob Winch
parent
commit
88181c31f1
  1. 3
      ldap/src/test/java/org/springframework/security/ldap/authentication/ad/ActiveDirectoryLdapAuthenticationProviderTests.java

3
ldap/src/test/java/org/springframework/security/ldap/authentication/ad/ActiveDirectoryLdapAuthenticationProviderTests.java

@ -412,9 +412,10 @@ public class ActiveDirectoryLdapAuthenticationProviderTests { @@ -412,9 +412,10 @@ public class ActiveDirectoryLdapAuthenticationProviderTests {
try {
provider.authenticate(joe);
fail("CommunicationException was expected with a root cause of ClassNotFoundException");
}
catch (org.springframework.ldap.CommunicationException expected) {
assertThat(expected.getCause()).isNotInstanceOf(ClassNotFoundException.class);
assertThat(expected.getRootCause()).isInstanceOf(ClassNotFoundException.class);
}
}

Loading…
Cancel
Save