Examples of CategoryImpl


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

    public void createCategory_invalidToken(){
        Model model = new ExtendedModelMap();
        String invalidToken =  AdminControllerUtil.generateSessionToken();
        User user = new UserImpl();
        String categoryText = "Social";
        CategoryImpl category = new CategoryImpl();
        category.setText(categoryText);
        SessionStatus sessionStatus = createMock(SessionStatus.class);
        expect(userService.getAuthenticatedUser()).andReturn(user).once();
        expect(categoryService.create(categoryText, user)).andReturn(new CategoryImpl());
        sessionStatus.setComplete();
        expectLastCall();
        replay(userService, categoryService,sessionStatus);
        String view = controller.createCategory(category, validToken, invalidToken, model, sessionStatus);
        assertTrue("Test should catch exception and never hit this test", false);
View Full Code Here

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

    @Test
    public void createCategory_invalidValidRequest_emptyText(){
        Model model = new ExtendedModelMap();
        User user = new UserImpl();
        String categoryText = "";
        CategoryImpl category = new CategoryImpl();
        category.setText(categoryText);
        SessionStatus sessionStatus = createMock(SessionStatus.class);
        expect(userService.getAuthenticatedUser()).andReturn(user).once();
        replay(userService);
        String view = controller.createCategory(category, validToken, validToken, model, sessionStatus);
        assertEquals("ViewName match", ViewNames.ADMIN_CATEGORIES, view);
View Full Code Here

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

    public void updateCategory_valid(){
        Model model = new ExtendedModelMap();
        User user = new UserImpl();
        long id = 1L;
        String categoryText = "Social";
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUser(user);
        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();
        long id = 1L;
        String categoryText = "Social";
        String invalidToken = AdminControllerUtil.generateSessionToken();
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUser(user);
        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();

        long id = 1L;
        String categoryText = "";
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUser(user);
        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, 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();
        long id = 1L;
        User user = new UserImpl();
        String categoryText = "Social";
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUser(user);
        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, 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();
        long id = 1L;
        String categoryText = "Social";
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUser(user);
        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, 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();
        long id = 1L;
        String categoryText = "Social";
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUser(user);
        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();
        long id = 1L;
        String categoryText = "Social";
        String invalidToken = AdminControllerUtil.generateSessionToken();
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUser(user);
        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();

        long id = 1L;
        String categoryText = "";
        CategoryImpl category = new CategoryImpl();
        category.setCreatedUser(user);
        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", model, sessionStatus);
        assertEquals("ViewName match", ViewNames.ADMIN_CATEGORY_DETAIL, view);
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.