Examples of SessionStatus


Examples of org.springframework.web.bind.support.SessionStatus

        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();
        expectLastCall();
        replay(userService, categoryService,sessionStatus);
        String view = controller.updateCategory(category, validToken, invalidToken,REFERRER_ID, model, sessionStatus);assertTrue("Test should catch exception and never hit this test", false);
        assertTrue("Test should catch exception and never hit this test", false);
    }
View Full Code Here

Examples of org.springframework.web.bind.support.SessionStatus

        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);
        assertFalse("empty model", model.asMap().isEmpty());
View Full Code Here

Examples of org.springframework.web.bind.support.SessionStatus

        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);
        assertFalse("empty model", model.asMap().isEmpty());
View Full Code Here

Examples of org.springframework.web.bind.support.SessionStatus

        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);
        assertEquals("ViewName match", ViewNames.ADMIN_CATEGORY_DETAIL, view);
View Full Code Here

Examples of org.springframework.web.bind.support.SessionStatus

        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();
        sessionStatus.setComplete();
        expectLastCall();
        replay(userService, categoryService,sessionStatus);
        String view = controller.deleteCategory(category, validToken, validToken, "true",REFERRER_ID, model,sessionStatus);
        assertEquals("ViewName match", "redirect:/app/admin/categories?action=delete&referringPageId=" + REFERRER_ID, view);
        assertTrue("empty model", model.asMap().isEmpty());
View Full Code Here

Examples of org.springframework.web.bind.support.SessionStatus

        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();
        sessionStatus.setComplete();
        expectLastCall();
        replay(userService, categoryService,sessionStatus);
        String view = controller.deleteCategory(category, validToken, invalidToken, "true",REFERRER_ID, model, sessionStatus);assertTrue("Test should catch exception and never hit this test", false);
        assertTrue("Test should catch exception and never hit this test", false);
    }
View Full Code Here

Examples of org.springframework.web.bind.support.SessionStatus

        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);
        assertFalse("empty model", model.asMap().isEmpty());
View Full Code Here

Examples of org.springframework.web.bind.support.SessionStatus

        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);
        assertFalse("empty model", model.asMap().isEmpty());
View Full Code Here

Examples of org.springframework.web.bind.support.SessionStatus

        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);
        assertEquals("ViewName match", ViewNames.ADMIN_CATEGORY_DETAIL, view);
View Full Code Here

Examples of org.springframework.web.bind.support.SessionStatus

        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);
        assertEquals("missing confirmation", true, model.asMap().get("missingConfirm"));
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.