@Test
    public void testBytes() {
        val profile = new CommonProfile();
        profile.setId(ID);
        profile.addAttribute(KEY, VALUE);

        val serializer = new JsonSerializer(CommonProfile.class);
        val encoded = serializer.serializeToBytes(profile);
        UserProfile decoded = (CommonProfile) serializer.deserializeFromBytes(encoded);

        assertEquals(decoded.getId(), profile.getId());
        assertEquals(1, profile.getAttributes().size());
        assertEquals(VALUE, profile.getAttribute(KEY));
    }
Tests {@link Serializer}.

@author Jerome LELEU
@since 3.9.0
pac4j-core/src/test/java/org/pac4j/core/util/serializer/JsonSerializerTest.java