@BeforeAll
    public static void bootstrap() throws Exception {
        @Cleanup
        val localhost = new LDAPConnection("localhost", LDAP_PORT,
            "cn=Directory Manager", "password");
        localhost.connect("localhost", LDAP_PORT);
        localhost.bind("cn=Directory Manager", "password");
        LdapIntegrationTestsOperations.populateEntries(
            localhost,
            new ClassPathResource("ldif/ldap-surrogates-ou.ldif").getInputStream(),
            "dc=example,dc=org");

        val ldif = IOUtils.toString(new ClassPathResource("ldif/ldap-surrogate.ldif").getInputStream(), StandardCharsets.UTF_8)
            .replace("$user", USER).replace("$admin", ADMIN_USER);
        LdapIntegrationTestsOperations.populateEntries(
            localhost,
            new ByteArrayInputStream(ldif.getBytes(StandardCharsets.UTF_8)),
            "ou=surrogates,dc=example,dc=org");
    }
This is {@link SurrogateLdapAuthenticationServiceTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-surrogate-authentication-ldap/src/test/java/org/apereo/cas/authentication/surrogate/SurrogateLdapAuthenticationServiceTests.java