Package org.encuestame.utils.web

Examples of org.encuestame.utils.web.UserAccountBean


    @Category(InternetTest.class)
    @Test
    public void testCreateUserwithPassword() throws EnMeExpcetion {
        createDefaultPermission();
        UserAccount secCreateUser = new UserAccount();
        UserAccountBean userCreateBean = ConvertDomainBean
                .convertSecondaryUserToUserBean(secCreateUser);
        userCreateBean.setPassword("12345");
        userCreateBean.setEmail("demo1@demo.org");
        userCreateBean.setUsername("demo1");
        userCreateBean.setStatus(true);
        userCreateBean.setName("Diana Paola");
        userCreateBean.setDateNew(new Date());
        userCreateBean.setPrimaryUserId(createAccount().getUid());
        securityService.createUser(userCreateBean,
                this.userAccount.getUsername());
        // TODO: need assert
        final UserAccount user = getAccountDao().getUserByUsername(
                userCreateBean.getUsername());
        assertNotNull("should be equals", user);
        assertEquals("should be equals", 1, user.getSecUserPermissions().size());
    }
View Full Code Here


     */
    @Category(DefaultTest.class)
    @Test
    public void testAssignPermissionwithIdUsername() throws EnMeExpcetion {
        final UserAccount secUser = createUserAccount("demo", this.userPrimary);
        final UserAccountBean userPermissionBean = ConvertDomainBean
                .convertSecondaryUserToUserBean(secUser);
        final UnitPermission permissionBean = ConvertDomainBean
                .convertPermissionToBean(this.permission);
        userPermissionBean.setId(userPermissionBean.getId());
        userPermissionBean.setUsername("demo");
        securityService.assignPermission(userPermissionBean, permissionBean);
        assertEquals("should be equals", 1, secUser.getSecUserPermissions()
                .size());
    }
View Full Code Here

     *             EnMeExpcetion
     */
    @Category(DefaultTest.class)
    @Test(expected = EnMeExpcetion.class)
    public void testAssignPermissionwithoutIdUsername() throws EnMeExpcetion {
        final UserAccountBean userPermissionBean = new UserAccountBean();
        final UnitPermission permissionBean = ConvertDomainBean
                .convertPermissionToBean(this.permission);
        // modify id user id.
        userPermissionBean.setId(1L);
        securityService.assignPermission(userPermissionBean, permissionBean);
    }
View Full Code Here

    @Category(DefaultTest.class)
    @Test(expected = EnMeExpcetion.class)
    public void testAssignPermissionwithPermission() throws EnMeExpcetion {
        final UserAccount secUser = createUserAccount("juanpicado2",
                this.userPrimary);
        final UserAccountBean userPermissionBean = ConvertDomainBean
                .convertSecondaryUserToUserBean(secUser);
        final UnitPermission permissionBean = new UnitPermission();
        // modify id permission.
        permissionBean.setId(1L);
        permissionBean.setPermission("auditor");
View Full Code Here

     */
    @Category(DefaultTest.class)
    @Test(expected = EnMeExpcetion.class)
    public void testAssignPermissionwithPermissionIdandUserId()
            throws EnMeExpcetion {
        UserAccountBean userPermissionBean = new UserAccountBean();
        UnitPermission permissionBean = new UnitPermission();
        securityService.assignPermission(userPermissionBean, permissionBean);

    }
View Full Code Here

    @Test
    public void testAssignGroup() throws EnMeExpcetion {
        final UserAccount users = createUserAccount("juanpicado",
                this.userPrimary);
        final Group groups = createGroups("encuestador");
        UserAccountBean userBean = ConvertDomainBean
                .convertSecondaryUserToUserBean(users);
        UnitGroupBean groupBean = ConvertDomainBean
                .convertGroupDomainToBean(groups);
        // securityService.assingGroup(userBean, groupBean);
    }
View Full Code Here

     * @throws EnMeExpcetion
     *             Exception
     */
    // @Test(expected = EnMeExpcetion.class)
    public void testassingGroupFromUserException() throws EnMeExpcetion {
        final UserAccountBean userBean = ConvertDomainBean
                .convertSecondaryUserToUserBean(this.userAccount);
        // this.securityService.assingGroupFromUser(userBean, new
        // UnitGroupBean());
    }
View Full Code Here

        final String inviteCode = RandomStringUtils.randomNumeric(6);
        final UserAccount account = createUserAccount("jota", "jota@jota.com",
                createAccount());
        account.setInviteCode(inviteCode);
        getAccountDao().saveOrUpdate(account);
        final UserAccountBean userAccBean = securityService
                .getUserAccountbyCode(inviteCode);
        assertNotNull(userAccBean);
    }
View Full Code Here

     * @return {@link UserAccountBean}
     */
    @Cacheable(cacheName = "searchUserByUsername")
    public UserAccountBean searchUserByUsername(final String username) {
        final UserAccount userDomain = getAccountDao().getUserByUsername(username);
        UserAccountBean user = null;
        if (userDomain != null) {
            user = ConvertDomainBean.convertSecondaryUserToUserBean(userDomain);
        } else {
            log.error("user not found");
        }
View Full Code Here

            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error(e);
        }
        final UserAccountBean bean = ConvertDomainBean.convertBasicSecondaryUserToUserBean(userAccount);
        log.debug("------ administration return ----> userBean "+bean.toString());
        return bean;
    }
View Full Code Here

TOP

Related Classes of org.encuestame.utils.web.UserAccountBean

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.