@Test
    public void testParsingAttributesCASServerV5() throws IOException {
        final Map<String, Object> attributes = new HashMap<>();
        attributes.put(KEY, VALUE);
        attributes.put(NAME, TOKEN);
        final Map<String, Object> map = new HashMap<>();
        map.put("id", ID);
        map.put("attributes", attributes);
        val body = new ObjectMapper()
                .writer()
                .withDefaultPrettyPrinter()
                .writeValueAsString(map);
        val client = new CasOAuthWrapperClient();
        client.setKey(KEY);
        client.setSecret(SECRET);
        client.setCasOAuthUrl(CALLBACK_URL);
        client.setCallbackUrl(CALLBACK_URL);
        client.init();
        val profile = new CasOAuthWrapperProfileDefinition().extractUserProfile(body);
        assertEquals(ID, profile.getId());
        assertEquals(2, profile.getAttributes().size());
        assertEquals(VALUE, profile.getAttribute(KEY));
        assertEquals(TOKEN, profile.getAttribute(NAME));
    }
Tests the profile parsing from the {@link CasOAuthWrapperClient}.

@author Jerome Leleu
@since 1.9.2
pac4j-oauth/src/test/java/org/pac4j/oauth/client/CasOAuthWrapperClientTests.java