Package org.springframework.social.connect

Examples of org.springframework.social.connect.UserProfile


        Person currentUser = alfresco.getCurrentUser();
        String displayName = connection.getDisplayName();
       
        assertEquals(currentUser.getFirstName() + " " + currentUser.getLastName(), displayName);
       
        UserProfile userProfile = connection.fetchUserProfile();
       
        assertEquals(currentUser.getEmail(), userProfile.getEmail());
        assertEquals(currentUser.getFirstName(), userProfile.getFirstName());
        assertEquals(currentUser.getLastName(), userProfile.getLastName());
        assertEquals(currentUser.getId(), userProfile.getUsername());
    }
View Full Code Here


    this.connectionRepositoryProvider = connectionRepositoryProvider;
  }

  @RequestMapping("/")
  public String home(Principal currentUser, Model model) {
    UserProfile profile = getConnectionRepository().findPrimaryConnection(Facebook.class).fetchUserProfile();
    model.addAttribute(profile);
    return "home";
  }
View Full Code Here

public abstract class AbstractSpringSocialProfileFactory<P extends SpringSocialProfile> {

  public P create(Connection<?> connection)
  {
    P profile = instantiate();
    UserProfile userProfile = connection.fetchUserProfile();
    init(profile,userProfile,connection.createData());
    return profile;
   
  }
View Full Code Here

  @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());
    assertNull(profile.getUsername());
  }
View Full Code Here

TOP

Related Classes of org.springframework.social.connect.UserProfile

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.