@Test
    void verifySerializeToJson() throws Throwable {
        val jsonFile = Files.createTempFile(RandomUtils.randomAlphabetic(8), ".json").toFile();
        val policy = new PatternMatchingAttributeReleasePolicy();
        assertNotNull(policy.getName());
        policy.getAllowedAttributes().put("memberOf",
            new PatternMatchingAttributeReleasePolicy.Rule()
                .setPattern("CN=(\\w+),OU=(\\w+)")
                .setTransform("${1}/${2}"));
        MAPPER.writeValue(jsonFile, policy);
        val policyRead = MAPPER.readValue(jsonFile, PatternMatchingAttributeReleasePolicy.class);
        assertEquals(policy, policyRead);
    }
This is {@link PatternMatchingAttributeReleasePolicyTests}.

@author Misagh Moayyed
@since 6.6.0
core/cas-server-core-authentication-attributes/src/test/java/org/apereo/cas/services/PatternMatchingAttributeReleasePolicyTests.java