@@ -0,0 +1,2297 @@
+package gov.nih.nci.cabig.caaers.web;%0A%0A%0Aimport gov.nih.nci.cabig.caaers.AbstractTestCase;%0Aimport gov.nih.nci.cabig.caaers.security.CaaersSecurityFacade;%0Aimport gov.nih.nci.cabig.caaers.security.SecurityTestUtils;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.HashMap;%0A%0Aimport org.acegisecurity.Authentication;%0Aimport org.easymock.classextension.EasyMock;%0Aimport org.springframework.web.servlet.ModelAndView;%0A%0Apublic class TaskResolverControllerTest extends AbstractTestCase %7B%0A%09%0A%09private TaskResolverController taskResolverController;%0A%09private CaaersSecurityFacade caaersSecurityFacade;%0A%09%0A%09@Override%0A%09protected void setUp() throws Exception %7B%0A%09%09super.setUp();%0A%09%09SecurityTestUtils.switchToSuperuser();%0A%09%09taskResolverController = new TaskResolverController();%0A%09%09caaersSecurityFacade = registerMockFor(CaaersSecurityFacade.class);%0A%09%09taskResolverController.setCaaersSecurityFacade(caaersSecurityFacade);%0A%09%7D%0A%09%0A%09public void testHandleRequestInternalNull() %7B%0A%09%09taskResolverController.setUrls(new ArrayList%3CString%3E());%0A%09%09assertNull(taskResolverController.handleRequestInternal(null, null));%0A%09%09%0A%09%09taskResolverController.setUrls(Arrays.asList(new String%5B%5D%7B%22abc%22%7D));%0A%09%09taskResolverController.setObjectPrivilegeMap(new HashMap%3CString, String%3E());%0A%09%09assertNull(taskResolverController.handleRequestInternal(null, null));%0A%09%09%0A%09%09taskResolverController.setObjectPrivilegeMap(new HashMap%3CString, String%3E() %7B%7B%0A%09%09%09   put(%22abc%22, %22pqr:xyz%22);%0A%09%09%09%7D%7D);%0A%09%09EasyMock.expect(caaersSecurityFacade.checkAuthorization(EasyMock.isA(Authentication.class), EasyMock.isA(String.class), EasyMock.isA(String.class))).andReturn(false);%0A%09%09replayMocks();%0A%09%09assertNull(taskResolverController.handleRequestInternal(null, null));%0A%09%09verifyMocks();%0A%09%7D%0A%09%0A%09public void testHandleRequestInternal() %7B%0A%09%09taskResolverController.setUrls(Arrays.asList(new String%5B%5D%7B%22abc%22%7D));%0A%09%09taskResolverController.setObjectPrivilegeMap(new HashMap%3CString, String%3E() %7B%7B%0A%09%09%09   put(%22abc%22, %22pqr:xyz%22);%0A%09%09%09%7D%7D);%0A%09%09EasyMock.expect(caaersSecurityFacade.checkAuthorization(EasyMock.isA(Authentication.class), EasyMock.isA(String.class), EasyMock.isA(String.class))).andReturn(true);%0A%09%09replayMocks();%0A%09%09ModelAndView mv = taskResolverController.handleRequestInternal(null, null);%0A%09%09assertEquals(%22redirect:abc%22, mv.getViewName());%0A%09%09verifyMocks();%0A%09%7D%0A%0A%7D%0A

Test case improvement.