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

Examples of org.springframework.social.google.api.plus.PlusOperations


  private Google google = Mockito.mock(Google.class);

  @Test
  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());
    assertEquals("Axel", profile.getLastName());
    assertEquals("guznik@gmail.com", profile.getEmail());
View Full Code Here

TOP

Related Classes of org.springframework.social.google.api.plus.PlusOperations

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.