@Test
    void verifyScriptedAttributeFilter() throws Throwable {
        val f = File.createTempFile("attr", ".groovy");
        val stream = new ClassPathResource("groovy-attr-filter.groovy").getInputStream();
        FileUtils.copyInputStreamToFile(stream, f);
        val filter = new RegisteredServiceScriptedAttributeFilter(0, "file:" + f.getCanonicalPath());
        val results = filter.filter(this.givenAttributesMap);
        assertEquals(3, results.size());
        val file = new File(FileUtils.getTempDirectoryPath(), "verifyScriptedAttributeFilter.json");
        MAPPER.writeValue(file, filter);
        val read = MAPPER.readValue(file, RegisteredServiceScriptedAttributeFilter.class);
        assertEquals(filter, read);
    }
This is {@link RegisteredServiceScriptedAttributeFilterTests}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-services/src/test/java/org/apereo/cas/services/support/RegisteredServiceScriptedAttributeFilterTests.java