Example #1
0
 @Override
 protected void verifyProfile(CommonProfile userProfile) {
   final PayPalProfile profile = (PayPalProfile) userProfile;
   assertEquals("YAxf5WKSFn4BG_l3wqcBJUSObQTG1Aww5FY0EDf_ccw", profile.getId());
   assertEquals(
       PayPalProfile.class.getName()
           + CommonProfile.SEPARATOR
           + "YAxf5WKSFn4BG_l3wqcBJUSObQTG1Aww5FY0EDf_ccw",
       profile.getTypedId());
   assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), PayPalProfile.class));
   assertTrue(CommonHelper.isNotBlank(profile.getAccessToken()));
   assertCommonProfile(
       userProfile,
       "*****@*****.**",
       "Test",
       "ScribeUP",
       "Test ScribeUP",
       null,
       Gender.UNSPECIFIED,
       Locale.FRANCE,
       null,
       null,
       "Europe/Berlin");
   final PayPalAddress address = profile.getAddress();
   assertEquals("FR", address.getCountry());
   assertEquals("Paris", address.getLocality());
   assertEquals("75001", address.getPostalCode());
   assertEquals("Adr1", address.getStreetAddress());
   final Locale language = profile.getLanguage();
   assertEquals(Locale.FRANCE, language);
   assertEquals(9, profile.getAttributes().size());
 }
Example #2
0
 @Override
 protected void verifyProfile(final UserProfile userProfile) {
   final DropBoxProfile profile = (DropBoxProfile) userProfile;
   logger.debug("userProfile : {}", profile);
   assertEquals("75206624", profile.getId());
   assertEquals(
       DropBoxProfile.class.getSimpleName() + UserProfile.SEPARATOR + "75206624",
       profile.getTypedId());
   assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), DropBoxProfile.class));
   assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
   assertCommonProfile(
       userProfile,
       null,
       null,
       null,
       "Test ScribeUP",
       null,
       Gender.UNSPECIFIED,
       Locale.FRENCH,
       null,
       "https://db.tt/RvmZyvJa",
       null);
   assertEquals(0L, profile.getShared().longValue());
   assertEquals(1410412L, profile.getNormal().longValue());
   assertEquals(2147483648L, profile.getQuota().longValue());
   assertNotNull(profile.getAccessSecret());
   assertEquals(8, profile.getAttributes().size());
 }
Example #3
0
 @Override
 protected void verifyProfile(UserProfile userProfile) {
   final Google2Profile profile = (Google2Profile) userProfile;
   assertEquals("113675986756217860428", profile.getId());
   assertEquals(
       Google2Profile.class.getName() + UserProfile.SEPARATOR + "113675986756217860428",
       profile.getTypedId());
   assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), Google2Profile.class));
   assertTrue(CommonHelper.isNotBlank(profile.getAccessToken()));
   assertCommonProfile(
       userProfile,
       "*****@*****.**",
       "Jérôme",
       "ScribeUP",
       "Jérôme ScribeUP",
       null,
       Gender.MALE,
       Locale.ENGLISH,
       "https://lh4.googleusercontent.com/-fFUNeYqT6bk/AAAAAAAAAAI/AAAAAAAAAAA/5gBL6csVWio/photo.jpg",
       "https://plus.google.com/113675986756217860428",
       null);
   assertNull(profile.getBirthday());
   assertTrue(profile.getEmails() != null && profile.getEmails().size() == 1);
   assertEquals(9, profile.getAttributes().size());
 }
 @Override
 protected void verifyProfile(final UserProfile userProfile) {
   final MyOpenIdProfile profile = (MyOpenIdProfile) userProfile;
   logger.debug("userProfile : {}", profile);
   assertEquals("http://testpac4j.myopenid.com/", profile.getId());
   assertEquals(
       MyOpenIdProfile.class.getSimpleName()
           + UserProfile.SEPARATOR
           + "http://testpac4j.myopenid.com/",
       profile.getTypedId());
   assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), MyOpenIdProfile.class));
   assertCommonProfile(
       userProfile,
       "*****@*****.**",
       null,
       null,
       "Test pac4j",
       null,
       Gender.UNSPECIFIED,
       null,
       null,
       null,
       null);
   assertEquals(2, profile.getAttributes().size());
 }
Example #5
0
 @Override
 protected void verifyProfile(UserProfile userProfile) {
   final WordPressProfile profile = (WordPressProfile) userProfile;
   logger.debug("userProfile : {}", profile);
   assertEquals("35944437", profile.getId());
   assertEquals(
       WordPressProfile.class.getName() + UserProfile.SEPARATOR + "35944437",
       profile.getTypedId());
   assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), WordPressProfile.class));
   assertTrue(CommonHelper.isNotBlank(profile.getAccessToken()));
   assertCommonProfile(
       userProfile,
       "*****@*****.**",
       null,
       null,
       "testscribeup",
       "testscribeup",
       Gender.UNSPECIFIED,
       null,
       "https://0.gravatar.com/avatar/67c3844a672979889c1e3abbd8c4eb22?s=96&d=identicon&r=G",
       "http://en.gravatar.com/testscribeup",
       null);
   assertEquals(36224958, profile.getPrimaryBlog().intValue());
   final WordPressLinks links = profile.getLinks();
   assertEquals("https://public-api.wordpress.com/rest/v1/me", links.getSelf());
   assertEquals("https://public-api.wordpress.com/rest/v1/me/help", links.getHelp());
   assertEquals("https://public-api.wordpress.com/rest/v1/sites/36224958", links.getSite());
   assertEquals(8, profile.getAttributes().size());
 }
Example #6
0
 @Override
 protected void verifyProfile(UserProfile userProfile) {
   final TwitterProfile profile = (TwitterProfile) userProfile;
   assertEquals("488358057", profile.getId());
   assertEquals(
       TwitterProfile.class.getName() + UserProfile.SEPARATOR + "488358057", profile.getTypedId());
   assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), TwitterProfile.class));
   assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
   assertCommonProfile(
       userProfile,
       null,
       null,
       null,
       "test scribeUP",
       "testscribeUP",
       Gender.UNSPECIFIED,
       Locale.UK,
       ".twimg.com/sticky/default_profile_images/default_profile_5_normal.png",
       "http://t.co/fNjYqp7wZ8",
       "New York");
   assertFalse(profile.getContributorsEnabled());
   assertEquals(
       TestsHelper.getFormattedDate(1328872224000L, "EEE MMM dd HH:mm:ss Z yyyy", Locale.US),
       profile.getCreatedAt().toString());
   assertTrue(profile.getDefaultProfile());
   assertTrue(profile.getDefaultProfileImage());
   assertEquals("biographie", profile.getDescription());
   assertEquals(0, profile.getFavouritesCount().intValue());
   assertFalse(profile.getFollowRequestSent());
   assertEquals(0, profile.getFollowersCount().intValue());
   assertFalse(profile.getFollowing());
   assertEquals(0, profile.getFriendsCount().intValue());
   assertFalse(profile.getGeoEnabled());
   assertFalse(profile.getIsTranslator());
   assertEquals(0, profile.getListedCount().intValue());
   assertFalse(profile.getNotifications());
   assertTrue(profile.getProfileBackgroundColor() instanceof Color);
   assertTrue(
       profile.getProfileBackgroundImageUrl().contains(".twimg.com/images/themes/theme1/bg.png"));
   assertTrue(
       profile.getProfileBackgroundImageUrlHttps().endsWith("/images/themes/theme1/bg.png"));
   assertFalse(profile.getProfileBackgroundTile());
   assertTrue(
       profile
           .getProfileImageUrlHttps()
           .endsWith("/sticky/default_profile_images/default_profile_5_normal.png"));
   assertTrue(profile.getProfileLinkColor() instanceof Color);
   assertTrue(profile.getProfileSidebarBorderColor() instanceof Color);
   assertTrue(profile.getProfileSidebarFillColor() instanceof Color);
   assertTrue(profile.getProfileTextColor() instanceof Color);
   assertTrue(profile.getProfileUseBackgroundImage());
   assertTrue(profile.getProtected());
   assertNull(profile.getShowAllInlineMedia());
   assertEquals(0, profile.getStatusesCount().intValue());
   assertEquals("Amsterdam", profile.getTimeZone());
   assertEquals(3600, profile.getUtcOffset().intValue());
   assertFalse(profile.getVerified());
   assertNotNull(profile.getAccessSecret());
   assertEquals(37, profile.getAttributes().size());
 }
Example #7
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);
 }