ProjectController { @RequestMapping(value="/create", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(EDIT_PROJECT)") public String createProject(Model model) { ProjectForm form = new ProjectForm(null, null); model.addAttribute("projectForm", form); return "/project/edit"; }  @RequestMapping(value="/{name:" + DocumentrConstants.PROJECT_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasProjectPermission(#name, VIEW)") String getProject(@PathVariable String name, Model model); @RequestMapping(value="/create", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(EDIT_PROJECT)") String createProject(Model model); @RequestMapping(value="/edit/{name:" + DocumentrConstants.PROJECT_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasProjectPermission(#name, EDIT_PROJECT)") String editProject(@PathVariable String name, Model model); @RequestMapping(value="/save", method=RequestMethod.POST) @PreAuthorize("projectExists(#form.name) ? " + "hasProjectPermission(#form.name, EDIT_PROJECT) : " + "hasApplicationPermission(EDIT_PROJECT)") String saveProject(@ModelAttribute @Valid ProjectForm form, BindingResult bindingResult,
			Authentication authentication); @RequestMapping(value="/importSample/{name:" + DocumentrConstants.PROJECT_NAME_PATTERN + "}/json", method=RequestMethod.GET) @PreAuthorize("hasProjectPermission(#name, ADMIN)") @ResponseBody Map<String, Object> importSampleContents(@PathVariable String name); @RequestMapping(value="/delete/{name:" + DocumentrConstants.PROJECT_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(EDIT_PROJECT)") String deleteProject(@PathVariable String name, Authentication authentication); @ModelAttribute ProjectForm createProjectForm(@RequestParam(required=false) String name,
			@RequestParam(required=false) String originalName);  }
@Test public void createProject() { String view = projectController.createProject(model); assertEquals("/project/edit", view); verify(model).addAttribute(eq("projectForm"), argProjectForm(null)); }