@Test
    void verifySerializeToJson() throws IOException {
        val policyWritten = new DefaultRegisteredServiceConsentPolicy(CollectionUtils.wrapSet("attr1", "attr2"),
            CollectionUtils.wrapSet("ex-attr1", "ex-attr2"));
        policyWritten.setStatus(TriStateBoolean.TRUE);

        val jsonFile = Files.createTempFile(RandomUtils.randomAlphabetic(8), ".json").toFile();
        MAPPER.writeValue(jsonFile, policyWritten);
        val policyRead = MAPPER.readValue(jsonFile, DefaultRegisteredServiceConsentPolicy.class);
        assertEquals(policyWritten, policyRead);
    }
This is {@link DefaultRegisteredServiceConsentPolicyTests}.

@author Misagh Moayyed
@since 6.1.0
core/cas-server-core-authentication-attributes/src/test/java/org/apereo/cas/services/consent/DefaultRegisteredServiceConsentPolicyTests.java