@Test
    void verifyScriptedFilter() {
        val appCtx = new StaticApplicationContext();
        appCtx.refresh();
        ApplicationContextProvider.holdApplicationContext(appCtx);
        assertThrows(RuntimeException.class,
            () -> LdapUtils.newLdaptiveSearchFilter("classpath:LdapFilterQuery.groovy",
                List.of("p1", "p2"), List.of("v1", "v2")));

        ApplicationContextProvider.holdApplicationContext(applicationContext);
        var filter = LdapUtils.newLdaptiveSearchFilter("classpath:LdapFilterQuery.groovy",
            List.of("p1", "p2"), List.of("v1", "v2"));
        assertNotNull(filter);
        assertNotNull(filter.getFilter());
    }
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