Package org.springframework.social.facebook.api

Examples of org.springframework.social.facebook.api.UserOperations


 
  private Facebook facebook = Mockito.mock(Facebook.class);
 
  @Test
  public void fetchProfile() {   
    UserOperations userOperations = Mockito.mock(UserOperations.class);
    Mockito.when(facebook.userOperations()).thenReturn(userOperations);
    Mockito.when(userOperations.getUserProfile()).thenReturn(new FacebookProfile("12345678", "Craig Walls", "Craig", "Walls", null, null));
    UserProfile profile = apiAdapter.fetchUserProfile(facebook);
    assertEquals("Craig Walls", profile.getName());
    assertEquals("Craig", profile.getFirstName());
    assertEquals("Walls", profile.getLastName());
    assertNull(profile.getEmail());
View Full Code Here


    assertNull(profile.getUsername());
  }

  @Test
  public void setConnectionValues() {   
    UserOperations userOperations = Mockito.mock(UserOperations.class);
    Mockito.when(facebook.userOperations()).thenReturn(userOperations);
    Mockito.when(userOperations.getUserProfile()).thenReturn(new FacebookProfile("12345678", "Craig Walls", "Craig", "Walls", null, null));
    TestConnectionValues connectionValues = new TestConnectionValues();
    apiAdapter.setConnectionValues(facebook, connectionValues);
    assertEquals("Craig Walls", connectionValues.getDisplayName());
    assertEquals("http://graph.facebook.com/v1.0/12345678/picture", connectionValues.getImageUrl());
    assertEquals("http://facebook.com/profile.php?id=12345678", connectionValues.getProfileUrl());
View Full Code Here

TOP

Related Classes of org.springframework.social.facebook.api.UserOperations

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.