Examples of CategoryImpl


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

    public void deleteCategory_invalidValidRequest_nullUser(){
        Model model = new ExtendedModelMap();
        String id = "1";
        User user = new UserImpl();
        String categoryText = "Social";
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUserId(user.getId());
        category.setText(categoryText);
        category.setId(id);
        SessionStatus sessionStatus = createMock(SessionStatus.class);
        expect(userService.getAuthenticatedUser()).andReturn(user).once();
        replay(userService);
        String view = controller.deleteCategory(category, validToken, validToken, "true",REFERRER_ID, model, sessionStatus);
        assertEquals("ViewName match", ViewNames.ADMIN_CATEGORY_DETAIL, view);
View Full Code Here

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

    public void deleteCategory_invalidValidRequest_nullWidgetToDelete(){
        Model model = new ExtendedModelMap();
        User user = new UserImpl();
        String id = "1";
        String categoryText = "Social";
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUserId(user.getId());
        category.setText(categoryText);
        category.setId(id);
        SessionStatus sessionStatus = createMock(SessionStatus.class);
        expect(userService.getAuthenticatedUser()).andReturn(user).once();
        expect(categoryService.get(id)).andReturn(null).once();
        replay(userService, categoryService);
        String view = controller.deleteCategory(category, validToken, validToken,"true",REFERRER_ID, model, sessionStatus);
View Full Code Here

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

    public void deleteCategory_invalidValidRequest_falseConfirmation(){
        Model model = new ExtendedModelMap();
        User user = new UserImpl();
        String id = "1";
        String categoryText = "Social";
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUserId(user.getId());
        category.setText(categoryText);
        category.setId(id);
        SessionStatus sessionStatus = createMock(SessionStatus.class);
        expect(userService.getAuthenticatedUser()).andReturn(user).once();
        replay(userService);
        String view = controller.deleteCategory(category, validToken, validToken,"false",REFERRER_ID, model, sessionStatus);
        assertEquals("ViewName match", ViewNames.ADMIN_CATEGORY_DETAIL, view);
View Full Code Here

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

    public void editCategory_valid () {
        User user = new UserImpl();
        String id = "1";
        String categoryText = "Social";
        Model model = new ExtendedModelMap();
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUserId(user.getId());
        category.setText(categoryText);
        category.setId(id);
        expect(categoryService.get(id)).andReturn(category).once();
        replay(categoryService);
        String view = controller.editCategory(id,REFERRER_ID, model);
        assertEquals("ViewName match", ViewNames.ADMIN_CATEGORY_DETAIL, view);
        assertFalse("model is not empty", model.asMap().isEmpty());
View Full Code Here

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

        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);

        grantedAuthorities = new ArrayList<GrantedAuthority>();
        grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_USER"));
View Full Code Here

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

    @Transactional(readOnly=false)
    @Rollback(true)
    public void delete_implObject() {
        Category category = repository.get(VALID_ENTITY_ID.toString());
        assertThat(category, is(notNullValue()));
        CategoryImpl impl = new CategoryImpl(category.getId());
        repository.delete(impl);
        category = repository.get(VALID_ENTITY_ID.toString());
        assertThat(category, is(nullValue()));
    }
View Full Code Here

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

        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);
        validCategory.setCreatedDate(VALID_CREATED_DATE);
        validCategory.setLastModifiedUserId(VALID_LAST_MODIFIED_USER_ID);
View Full Code Here

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

    @Test
    public void getAll() {
        List<Category> list = new ArrayList<Category>();
        list.add(validCategory);
        list.add(new CategoryImpl());
        list.add(new CategoryImpl());

        expect(repository.getAll()).andReturn(list);
        replay(repository);
        assertThat(service.getAll(), is(list));
        verify(repository);
View Full Code Here

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

    @Test
    public void create() {
        final String NEW_CATEGORY_TEXT = "new category";
        final String NEW_ID = "1";
        Category expectedCategory = new CategoryImpl();
        expectedCategory.setText(NEW_CATEGORY_TEXT);

        expect(repository.save(expectedCategory)).andDelegateTo(new MockCategoryRepository() {
            @Override
            public Category save(Category item) {
                item.setId(NEW_ID);
View Full Code Here

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

    @Test
    public void update() {
        final String UPDATED_TEXT = "modified category";

        Category expectedSaveCategory = new CategoryImpl();
        expectedSaveCategory.setId(VALID_ID);
        expectedSaveCategory.setText(UPDATED_TEXT);
        expectedSaveCategory.setCreatedUserId(VALID_CREATED_USER_ID);
        expectedSaveCategory.setLastModifiedUserId(VALID_LAST_MODIFIED_USER_ID);
        expectedSaveCategory.setCreatedDate(VALID_CREATED_DATE);
        expectedSaveCategory.setLastModifiedDate(VALID_LAST_MODIFIED_DATE);

        expect(repository.get(VALID_ID)).andReturn(validCategory);
        expect(repository.save(expectedSaveCategory)).andReturn(expectedSaveCategory);
        replay(repository);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.