@Test
    void verifyPagedSearch() throws Throwable {
        val ldap = new Ldap();
        ldap.setBaseDn("ou=people,dc=example,dc=org");
        ldap.setLdapUrl("ldap://localhost:10389");
        ldap.setBindDn("cn=Directory Manager");
        ldap.setBindCredential("password");
        ldap.setSearchFilter("cn=invalid-user");

        var factory = new LdapConnectionFactory(LdapUtils.newLdaptiveConnectionFactory(ldap));
        var response = factory.executeSearchOperation(ldap.getBaseDn(),
            LdapUtils.newLdaptiveSearchFilter(ldap.getSearchFilter()), 10, "cn");
        assertNotNull(response);
        assertFalse(LdapUtils.containsResultEntry(response));
        factory.close();

        ldap.setDisablePooling(true);
        factory = new LdapConnectionFactory(LdapUtils.newLdaptiveConnectionFactory(ldap));
        response = factory.executeSearchOperation(ldap.getBaseDn(),
            LdapUtils.newLdaptiveSearchFilter(ldap.getSearchFilter()), 10, "cn");
        assertNotNull(response);
        assertFalse(LdapUtils.containsResultEntry(response));
        factory.close();
    }
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