Package securesocial.core

Examples of securesocial.core.Identity


* @author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
*/
public class BaseController extends Controller {

    protected static User getLoggedUser() {
        Identity socialUser = (Identity) ctx().args.get(SecureSocial.USER_KEY);
        User user = User.findByEmail(socialUser.email().get());
        return user;
    }
View Full Code Here


    public void should_return_default_user() throws Exception {
        final FakeApplication fakeApplication = Helpers.fakeApplication();
        running(fakeApplication, new Runnable() {
            @Override
            public void run() {
                final Identity identity = userService.doFind(new IdentityId("test","icule"));
                assertThat(identity).isNotNull();
                assertThat(identity).isEqualTo(defaultIdentity);
            }
        });
    }
View Full Code Here

    @Test
    public void should_not_save_user_twice() throws Exception {
        running(fakeApplication, new Runnable() {
            @Override
            public void run() {
                final Identity identity = defaultIdentity;
                assertThat(userService.doSave(identity)).isNotNull()
                    .isEqualTo(defaultIdentity);
                assertThat(userService.doSave(identity)).isNotNull()
                    .isEqualTo(defaultIdentity);
View Full Code Here

TOP

Related Classes of securesocial.core.Identity

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.