@Test
    void verifySsoPolicySerialization() {
        val policyWritten = new DefaultRegisteredServiceAcceptableUsagePolicy();
        policyWritten.setEnabled(true);
        policyWritten.setMessageCode("example.code");
        policyWritten.setText("example text");

        val registeredService = new CasRegisteredService();
        registeredService.setAcceptableUsagePolicy(policyWritten);

        val policy = new ChainingRegisteredServiceSingleSignOnParticipationPolicy();
        policy.addPolicies(Arrays.asList(
            new LastUsedTimeRegisteredServiceSingleSignOnParticipationPolicy(TimeUnit.SECONDS, 100, 1),
            new AuthenticationDateRegisteredServiceSingleSignOnParticipationPolicy(TimeUnit.SECONDS, 100, 1)));
        registeredService.setSingleSignOnParticipationPolicy(policy);
        val results = serializer.toString(registeredService);
        val read = serializer.from(results);
        assertEquals(registeredService, read);
    }
This is {@link RegisteredServiceJsonSerializerTests}.

@author Misagh Moayyed
@since 5.1.0
core/cas-server-core-services/src/test/java/org/apereo/cas/services/util/RegisteredServiceJsonSerializerTests.java