@Test
    void verifyLdapAuthnActiveDirectory() {
        val ldap = new Ldap();
        ldap.setLdapUrl("ldap://localhost:10389");
        ldap.setBindDn("cn=Directory Manager");
        ldap.setBindCredential("password");
        ldap.setBaseDn("ou=people,dc=example,dc=org");
        ldap.setSearchFilter("cn=invalid-user");
        ldap.setDerefAliases(DerefAliases.FINDING.name());
        ldap.setPrincipalAttributePassword("password");
        ldap.setFailFast(false);
        ldap.setType(AbstractLdapAuthenticationProperties.AuthenticationTypes.AD);
        assertThrows(IllegalArgumentException.class, () -> LdapUtils.newLdaptiveAuthenticator(ldap));
        ldap.setDnFormat("cn=%s,dc=example,dc=org");
        assertNotNull(LdapUtils.newLdaptiveAuthenticator(ldap));
    }
This is {@link LdapUtilsTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-ldap-core/src/test/java/org/apereo/cas/LdapUtilsTests.java