Permalink
Browse files

Merge pull request #112 from sherdeadlock/master

Fix UserProfile.getId() return null
  • Loading branch information...
mlaccetti committed Aug 30, 2017
2 parents 36c8430 + 9e5f80e commit 34e3d6d52d0f7563ebb0ebc43188263ea3494c7c
@@ -58,6 +58,7 @@ public void setConnectionValues(final Google google, final ConnectionValues valu
public UserProfile fetchUserProfile(final Google google) {
final UserInfo userInfo = google.oauth2Operations().getUserinfo();
return new UserProfileBuilder().setUsername(userInfo.getId())
.setId(userInfo.getId())
.setEmail(userInfo.getEmail())
.setName(userInfo.getName())
.setFirstName(userInfo.getGivenName())
@@ -44,6 +44,7 @@ public void fetchProfile() {
Mockito.when(oauth2Operations.getUserinfo()).thenReturn(userInfo);
final UserProfile profile = apiAdapter.fetchUserProfile(google);
assertEquals("114863353858610846998", profile.getId());
assertEquals("Gabriel Axel", profile.getName());
assertEquals("Gabriel", profile.getFirstName());
assertEquals("Axel", profile.getLastName());

0 comments on commit 34e3d6d

Please sign in to comment.