فهرست منبع

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.
Johnny Lim 7 سال پیش
والد
کامیت
88181c31f1

+ 2 - 1
ldap/src/test/java/org/springframework/security/ldap/authentication/ad/ActiveDirectoryLdapAuthenticationProviderTests.java

@@ -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);
 		}
 	}