Package org.jtalks.common.model.entity

Examples of org.jtalks.common.model.entity.User


        String passwordHash = "5f4dcc3b5aa765d61d8327deb882cf99";
        String email = "email@email.em";
        LoginUserDto loginUserDto = createDefaultLoginUserDto();
        Map<String, String> authInfo = createAuthInfo(username, email);
        Group group = new Group(AdministrationGroup.USER.getName());
        User commonUser = new User(username, email, password, null);
        commonUser.getGroups().add(group);
        when(groupDao.getGroupByName(group.getName())).thenReturn(group);
        when(userDao.getByUsername(username)).thenReturn(null);
        when(userDao.getCommonUserByUsername(username)).thenReturn(commonUser);
        when(encryptionService.encryptPassword(password)).thenReturn(passwordHash);
        prepareAuth();
View Full Code Here


    }

    @Test
    public void registerUserWithCorrectDetailsShouldBeSuccessful() throws Exception {
        RegisterUserDto userDto = createRegisterUserDto("username", "password", "email@email.em", null);
        User commonUser = new User("username", "email@email.em", "password", null);
        when(registrationPlugin.getState()).thenReturn(Plugin.State.ENABLED);
        when(registrationPlugin.registerUser(userDto.getUserDto(), null)).thenReturn(Collections.EMPTY_MAP);
        when(pluginLoader.getPlugins(any(TypeFilter.class))).thenReturn(Arrays.asList((Plugin) registrationPlugin));
        when(bindingResult.hasErrors()).thenReturn(false);
        when(userDao.getCommonUserByUsername("username")).thenReturn(commonUser);
View Full Code Here

        assertTrue(mav.getView() instanceof MappingJacksonJsonView);
        assertEquals(mav.getModel().get("errorMessage"), exception.getMessage());
    }

    private User userWithPassword(String password) {
        return new User("admin", "mail", password, "");
    }
View Full Code Here

     * @throws NotFoundException if the password sent by Poulpe is blank or does not match the one in the
     *                           database
     */
    private void assertAdminPasswordCorrect(String adminPassword) throws NotFoundException {
        checkArgument(isNotBlank(adminPassword), "No password specified while it is required");
        User admin = userService.getCommonUserByUsername(ADMIN_USERNAME);
        checkArgument(adminPassword.equals(admin.getPassword()),
                "Wrong password was specified during removal of branch/section/component.");
    }
View Full Code Here

TOP

Related Classes of org.jtalks.common.model.entity.User

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.