Package com.porterhead.rest.user.api

Examples of com.porterhead.rest.user.api.CreateUserRequest


    @Autowired
    public ApplicationConfig applicationConfig;


    protected AuthenticatedUserToken createUserWithRandomUserName(Role role) {
        CreateUserRequest request = getDefaultCreateUserRequest();
        return userService.createUser(request, role);
    }
View Full Code Here


        CreateUserRequest request = getDefaultCreateUserRequest();
        return userService.createUser(request, role);
    }

    protected CreateUserRequest getDefaultCreateUserRequest() {
        CreateUserRequest request = new CreateUserRequest();
        request.setUser(getUser());
        request.setPassword(new PasswordRequest("password"));
        return request;
    }
View Full Code Here

        environment = config.environment();
        emailServicesGateway = config.emailServicesGateway();
    }

    protected CreateUserRequest createSignupRequest() {
        return new CreateUserRequest(ExternalUserBuilder.create().withEmailAddress(TEST_USER.getEmailAddress())
                .withFirstName(TEST_USER.getFirstName()).withLastName(TEST_USER.getLastName()).build(), PASSWORD_REQUEST);
    }
View Full Code Here

    public void loginWithEmailAddressThenSocialLogin() {
        //set up services
        UserService userService = new UserServiceImpl(usersConnectionRepository, validator, applicationConfig);
        ((UserServiceImpl) userService).setUserRepository(userRepository);
        //create email account
        CreateUserRequest request = getCreateUserRequest(RandomStringUtils.randomAlphabetic(8) + "@example.com");
        AuthenticatedUserToken token = userService.createUser(request, Role.authenticated);

        UserProfileBuilder builder = new UserProfileBuilder();
        UserProfile profile = builder.setFirstName(user.getFirstName()).setLastName(user.getLastName()).setEmail(user.getEmailAddress()).setUsername("jsmith.12").build();
        when(connection.fetchUserProfile()).thenReturn(profile);
View Full Code Here

        ExternalUser user = userService.getUser(new ExternalUser(token.getUserId()), token.getUserId());
        assertThat(token.getUserId(), is(loginToken.getUserId()));
    }

    private CreateUserRequest getCreateUserRequest(String emailAddress) {
        CreateUserRequest request = new CreateUserRequest();
        ExternalUser user = ExternalUserBuilder.create().withFirstName("John")
                .withLastName("Smith")
                .withEmailAddress(emailAddress)
                .build();
        request.setUser(user);
        request.setPassword(new PasswordRequest("password"));
        return request;
    }
View Full Code Here

TOP

Related Classes of com.porterhead.rest.user.api.CreateUserRequest

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.