@Test
    void verifyUpdateAttributes() {
        val principal1 = CoreAuthenticationTestUtils.getPrincipal(UUID.randomUUID().toString(), Map.of("cn", List.of("Apereo")));
        val authentication1 = CoreAuthenticationTestUtils.getAuthentication(principal1, Map.of("method", List.of("simple")));
        assertEquals("simple", authentication1.getSingleValuedAttribute("method"));
        val principal2 = CoreAuthenticationTestUtils.getPrincipal(UUID.randomUUID().toString(), Map.of("cn", List.of("CAS"), "name", List.of("casuser", "casperson")));
        val authentication2 = CoreAuthenticationTestUtils.getAuthentication(principal2, Map.of("method", List.of("strong")));
        authentication1.updateAttributes(authentication2);
        assertTrue(authentication1.getAttributes().get("method").containsAll(List.of("simple", "strong")));
        assertTrue(authentication1.getPrincipal().getAttributes().get("cn").containsAll(List.of("Apereo", "CAS")));
        assertTrue(authentication1.getPrincipal().getAttributes().get("name").containsAll(List.of("casuser", "casperson")));
    }
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