Ejemplo n.º 1
0
 @Override
 protected OkProfile extractUserProfile(String body) {
   final OkProfile profile = new OkProfile();
   JsonNode userNode = JsonHelper.getFirstNode(body);
   if (userNode != null) {
     profile.setId(JsonHelper.getElement(userNode, OkAttributesDefinition.UID));
     for (final String attribute : profile.getAttributesDefinition().getPrimaryAttributes()) {
       profile.addAttribute(attribute, JsonHelper.getElement(userNode, attribute));
     }
   }
   return profile;
 }
Ejemplo n.º 2
0
 @Override
 protected void verifyProfile(UserProfile userProfile) {
   final OkProfile profile = (OkProfile) userProfile;
   assertEquals(TEST_PROFILE_ID, profile.getId());
   assertEquals(
       OkProfile.class.getSimpleName() + UserProfile.SEPARATOR + TEST_PROFILE_ID,
       profile.getTypedId());
   assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), OkProfile.class));
   assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
   assertCommonProfile(
       userProfile,
       null,
       TEST_FIRST_NAME,
       TEST_LAST_NAME,
       TEST_FIRST_NAME + " " + TEST_LAST_NAME,
       TEST_PROFILE_ID,
       Gender.MALE,
       new Locale(TEST_LOCALE),
       TEST_PROFILE_PICTURE_URL,
       OkProfile.BASE_PROFILE_URL + TEST_PROFILE_ID,
       TEST_LOCATION);
 }