Examples of CategoryImpl


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

    public void updateCategory_valid(){
        Model model = new ExtendedModelMap();
        User user = new UserImpl();
        String id = "1";
        String categoryText = "Social";
        CategoryImpl category = new CategoryImpl(id);
        category.setCreatedUserId(user.getId());
        category.setText(categoryText);
        SessionStatus sessionStatus = createMock(SessionStatus.class);
        expect(userService.getAuthenticatedUser()).andReturn(user).once();
        expect(categoryService.get(id)).andReturn(category);
        expect(categoryService.update(id, categoryText, user)).andReturn(category);
        sessionStatus.setComplete();
View Full Code Here

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

        Model model = new ExtendedModelMap();
        User user = new UserImpl();
        String id = "1";
        String categoryText = "Social";
        String invalidToken = AdminControllerUtil.generateSessionToken();
        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(category);
        expect(categoryService.update(id, categoryText, user)).andReturn(category);
        sessionStatus.setComplete();
View Full Code Here

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

        Model model = new ExtendedModelMap();
        User user = new UserImpl();

        String id = "1";
        String categoryText = "";
        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.updateCategory(category, validToken, validToken,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 updateCategory_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.updateCategory(category, validToken, validToken,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 updateCategory_invalidValidRequest_nullWidgetToUpdate(){
        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.updateCategory(category, validToken, validToken, REFERRER_ID, model, sessionStatus);
View Full Code Here

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

    public void deleteCategory_valid(){
        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(category).anyTimes();
        categoryService.delete(category);
        expectLastCall();
View Full Code Here

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

        Model model = new ExtendedModelMap();
        User user = new UserImpl();
        String id = "1";
        String categoryText = "Social";
        String invalidToken = AdminControllerUtil.generateSessionToken();
        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(category);
        categoryService.delete(category);
        expectLastCall();
View Full Code Here

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

        Model model = new ExtendedModelMap();
        User user = new UserImpl();

        String id = "1";
        String categoryText = "";
        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

        controller.setPreferenceService(preferenceService);
        categoryService = createMock(CategoryService.class);
        controller.setCategoryService(categoryService);

        categories = new ArrayList<Category>();
        categories.add(new CategoryImpl());
        categories.add(new CategoryImpl());

        webDataBinder = createMock(WebDataBinder.class);
        categoryEditor = new CategoryEditor(categoryService);
        controller.setCategoryEditor(categoryEditor);
    }
View Full Code Here

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

    @Before
    public void setUp() {
        categoryService = createMock(CategoryService.class);
        categoryEditor = new CategoryEditor(categoryService);

        validCategory = new CategoryImpl();
        validCategory.setId(CATEGORY_ID);
        validCategory.setText(CATEGORY_TEXT);
    }
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.