DeleteProjectController { @AccessPolicies({ @ElementAccessPolicy(type = CheckedElementType.PROJECT, paramIndex = 1, userRole = { RoleNames.ROLE_COLLABORATOR_OWNER, RoleNames.ROLE_PROJ_COLLABORATOR_ADMIN }) }) @RequestMapping(value = "auth/workbench/deleteproject/{projectId}", method = RequestMethod.GET) public ModelAndView deleteProjectRequest(@PathVariable("projectId") String projectId, RedirectAttributes redirectAttributes, Principal principal) throws QuadrigaStorageException, QuadrigaAccessException { ModelAndView model = new ModelAndView("redirect:/auth/workbench"); ArrayList<String> projectIdList = new ArrayList<String>(); projectIdList.add(projectId); projectManager.deleteProjectRequest(projectIdList, principal); redirectAttributes.addFlashAttribute("show_success_alert", true); redirectAttributes.addFlashAttribute("success_alert_msg", "The project has been successfully deleted."); return model; }  @AccessPolicies({ @ElementAccessPolicy(type = CheckedElementType.PROJECT, paramIndex = 1, userRole = { RoleNames.ROLE_COLLABORATOR_OWNER, RoleNames.ROLE_PROJ_COLLABORATOR_ADMIN }) }) @RequestMapping(value = "auth/workbench/deleteproject/{projectId}", method = RequestMethod.GET) ModelAndView deleteProjectRequest(@PathVariable("projectId") String projectId,
            RedirectAttributes redirectAttributes, Principal principal);  }
@Test public void deleteProjectRequestTest() throws QuadrigaStorageException, QuadrigaAccessException{ String mockProjectId = "testProjectId"; RedirectAttributes redirectAttributes = Mockito.mock(RedirectAttributes.class); ArrayList<String> projectIdList = new ArrayList<String>(); projectIdList.add(mockProjectId); ModelAndView actualModel = deleteProjectController.deleteProjectRequest(mockProjectId, redirectAttributes,principal); Mockito.verify(projectManager, Mockito.atLeastOnce()).deleteProjectRequest(projectIdList,principal); String expectedViewName = "redirect:/auth/workbench"; assertEquals(expectedViewName,actualModel.getViewName()); }