@Test
    void verifySerializeADefaultAuthenticationToJson() throws Throwable {
        val authn = CoreAuthenticationTestUtils.getAuthentication();
        MAPPER.writeValue(JSON_FILE, authn);
        val authn2 = MAPPER.readValue(JSON_FILE, Authentication.class);
        assertEquals(authn, authn2);
        assertTrue(authn.isEqualTo(authn2));
    }
Test for JSON Serialization

@author David Rodriguez
@since 5.0.0
core/cas-server-core-authentication/src/test/java/org/apereo/cas/authentication/DefaultAuthenticationTests.java