Package org.springframework.social.google.api.plus

Examples of org.springframework.social.google.api.plus.Person$Image


        }

        System.out.println(" =========  images ======== ");
        List<Image> images = artist.getImages();
        for (int i = 0; i < images.size(); i++) {
            Image image = images.get(i);
            image.dump();
        }

        System.out.println(" =========  news ======== ");
        List<News> newsList = artist.getNews();
        for (int i = 0; i < newsList.size(); i++) {
View Full Code Here


      return false;
    }
  }

  public void setConnectionValues(Google google, ConnectionValues values) {
    Person profile = google.plusOperations().getGoogleProfile();
    values.setProviderUserId(profile.getId());
    values.setDisplayName(profile.getDisplayName());
    values.setProfileUrl(profile.getUrl());
    values.setImageUrl(profile.getImageUrl());
  }
View Full Code Here

    values.setProfileUrl(profile.getUrl());
    values.setImageUrl(profile.getImageUrl());
  }

  public UserProfile fetchUserProfile(Google google) {
    Person profile = google.plusOperations().getGoogleProfile();
    return new UserProfileBuilder().setUsername(profile.getId())
        .setEmail(profile.getAccountEmail())
        .setName(profile.getDisplayName())
        .setFirstName(profile.getGivenName())
        .setLastName(profile.getFamilyName()).build();
  }
View Full Code Here

  public void fetchProfile() {

    PlusOperations plusOperations = Mockito.mock(PlusOperations.class);
    Mockito.when(google.plusOperations()).thenReturn(plusOperations);

    Person person = Mockito.mock(Person.class);
    Mockito.when(person.getDisplayName()).thenReturn("Gabriel Axel");
    Mockito.when(person.getGivenName()).thenReturn("Gabriel");
    Mockito.when(person.getFamilyName()).thenReturn("Axel");
    Mockito.when(person.getAccountEmail()).thenReturn("guznik@gmail.com");
    Mockito.when(person.getId()).thenReturn("114863353858610846998");

    Mockito.when(plusOperations.getGoogleProfile()).thenReturn(person);
    UserProfile profile = apiAdapter.fetchUserProfile(google);
    assertEquals("Gabriel Axel", profile.getName());
    assertEquals("Gabriel", profile.getFirstName());
View Full Code Here

TOP

Related Classes of org.springframework.social.google.api.plus.Person$Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.