Package org.apache.rave.portal.model.impl

Examples of org.apache.rave.portal.model.impl.UserImpl


        pageLayout = new PageLayoutImpl();
        pageLayout.setCode(PAGE_LAYOUT_CODE);
        pageLayout.setNumberOfRegions(3L);

        user = new UserImpl();
        user.setUsername("acarlucci");
        user.setId("1");
        user.setDefaultPageLayout(pageLayout);

        pageRepository = createMock(PageRepository.class);
View Full Code Here


    @Test
    public void getAllPersonProfilePages_noPersonPage() {
        List<Page> VALID_PAGES = new ArrayList<Page>();
        Page personPage = new PageImpl();
        PageTemplate pageTemplate = new PageTemplateImpl();
        UserImpl user = new UserImpl();

        expect(pageRepository.getAllPages(VALID_USER_ID, PageType.PERSON_PROFILE)).andReturn(VALID_PAGES);
        expect(userService.getUserById(isA(String.class))).andReturn(user).once();
        expect(pageTemplateRepository.getDefaultPage(PageType.PERSON_PROFILE)).andReturn(pageTemplate).once();
        expect(pageRepository.createPageForUser(user, pageTemplate)).andReturn(personPage);
View Full Code Here

    public void setUp() {
        mockCategoryRepository = createMock(CategoryRepository.class);
        defaultCategoryPermissionEvaluator = new DefaultCategoryPermissionEvaluator(mockCategoryRepository);
        mockAuthentication = createMock(Authentication.class);

        user = new UserImpl();
        user.setUsername(VALID_USERNAME);
        user.setId(VALID_USER_ID);
        user2 = new UserImpl();
        user2.setUsername(VALID_USERNAME2);

        category = new CategoryImpl();
        category.setId(VALID_WIDGET_CATEGORY_ID);
        category.setCreatedUserId(VALID_USER_ID);
View Full Code Here

      } else if ("fullname".equals(attribute.getName())
          && !attribute.getValues().isEmpty()) {
        displayName = attribute.getValues().get(0);
      }
    }
    User user = new UserImpl();
    String username = StringUtils.substringAfter(openId, "://").replace("/", "");
    if (username.length() > 35) {
      username = username.substring(0, 35);
    }
    if (displayName == null && firstName != null && lastName != null) {
      displayName = firstName + " " + lastName;
    }
    user.setUsername(username);
    user.setEmail(email);
    user.setGivenName(firstName);
    user.setFamilyName(lastName);
    user.setDisplayName(displayName);
    user.setOpenId(openId);

    return user;
  }
View Full Code Here

    @Rollback(true)
    public void save_new() {
        Date createdDate = new Date();
        Date lastModDate = new Date();
        String text = "my comment";
        User user = new UserImpl(VALID_USER_ID.toString());

        JpaWidgetComment wc = new JpaWidgetComment();
        wc.setCreatedDate(createdDate);
        wc.setWidgetId(VALID_WIDGET_ID.toString());
        wc.setLastModifiedDate(lastModDate);
View Full Code Here

    private ModelUtils() {}


    public static User convert(UserForm form) {
        User newUser = new UserImpl(form.getId(),  form.getUsername());
        newUser.setAuthorities(CollectionUtils.<Authority>toBaseTypedCollection(form.getAuthorities()));
        newUser.setPassword(form.getPassword());
        newUser.setConfirmPassword(form.getConfirmPassword());
        newUser.setForgotPasswordHash(form.getForgotPasswordHash());
        newUser.setDefaultPageLayoutCode(form.getDefaultPageLayoutCode());
        newUser.setStatus(form.getStatus());
        newUser.setAboutMe(form.getAboutMe());
        newUser.setGivenName(form.getGivenName());
        newUser.setFamilyName(form.getFamilyName());
        newUser.setDisplayName(form.getDisplayName());
        newUser.setEmail(form.getEmail());
        newUser.setOpenId(form.getOpenId());
        newUser.setEnabled(form.isEnabled());
        newUser.setExpired(form.isExpired());
        newUser.setLocked(form.isLocked());
        return newUser;
    }
View Full Code Here

    @Test
    public void getByOwmer(){
        int offset = 2;
        int pageSize = 10;
        User owner = new UserImpl("1234L");
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        w.setOwnerId(owner.getId());
        widgets.add(w);

        expect(template.find(isA(Query.class))).andReturn(widgets);
        replay(template);
View Full Code Here

    public void getcountByOwner(){
        long count = 0;
        int offset = 2;
        int pageSize = 10;
        String id = "1234L";
        User owner = new UserImpl(id);
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        w.setOwnerId(id);
        widgets.add(w);
View Full Code Here

    @Before
    public void setup() {
        repository = createMock(CategoryRepository.class);
        service = new DefaultCategoryService(repository);

        validCreatedUser = new UserImpl(VALID_CREATED_USER_ID);
        validLastModifiedUser = new UserImpl(VALID_LAST_MODIFIED_USER_ID);

        validCategory = new CategoryImpl();
        validCategory.setId(VALID_ID);
        validCategory.setText(VALID_TEXT);
        validCategory.setCreatedUserId(VALID_CREATED_USER_ID);
View Full Code Here

        validAuthoritySearchResult = new SearchResult<Authority>(validAuthorityList, validAuthorityList.size());
    }

    @Test
    public void createNewAccountTest() throws Exception {
        UserImpl newUser = new UserImpl();
        newUser.setUsername(VALID_USER);
        newUser.setPassword(VALID_PASSWORD);
        newUser.setConfirmPassword(VALID_PASSWORD);
        newUser.setEmail(VALID_EMAIL);
        newUser.setDefaultPageLayoutCode(VALID_LAYOUT_CODE);

        User expectedUser = new UserImpl();
        expectedUser.setUsername(newUser.getUsername());
        expectedUser.setPassword(newUser.getPassword());
        expectedUser.setEmail(newUser.getEmail());
        expectedUser.setDefaultPageLayout(validPageLayout);
        expectedUser.setExpired(false);
        expectedUser.setLocked(false);
        expectedUser.setEnabled(true);

        ReflectionTestUtils.setField(newAccountService, "passwordEncoder", passwordEncoder);

        expect(passwordEncoder.encode("valid.password")).andReturn("valid.password");
        expect(userService.getUserByUsername(VALID_USER)).andReturn(null);
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.impl.UserImpl

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.