@Test
    void verifyAuthenticateSuccess() throws Throwable {
        assertNotEquals(0, ldapAuthenticationHandlers.size());
        for (val handler : ldapAuthenticationHandlers.toList()) {
            val credential = new UsernamePasswordCredential(getUsername(), getSuccessPassword());
            val result = handler.authenticate(credential, mock(Service.class));
            assertNotNull(result.getPrincipal());
            assertEquals(credential.getUsername(), result.getPrincipal().getId());
            val attributes = result.getPrincipal().getAttributes();
            Arrays.stream(getPrincipalAttributes()).forEach(s -> assertTrue(attributes.containsKey(s)));
        }
    }
Unit test for {@link LdapAuthenticationHandler}.

@author Marvin S. Addison
@author Misagh Moayyed
@since 4.0.0
support/cas-server-support-ldap/src/test/java/org/apereo/cas/authentication/BaseLdapAuthenticationHandlerTests.java