BranchController { @RequestMapping(value="/create/{projectName:" + DocumentrConstants.PROJECT_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasProjectPermission(#projectName, EDIT_BRANCH)") public String createBranch(@PathVariable String projectName, Model model) { BranchForm form = new BranchForm(projectName, null, null, null); model.addAttribute("branchForm", form); return "/project/branch/edit"; }  @RequestMapping(value="/create/{projectName:" + DocumentrConstants.PROJECT_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasProjectPermission(#projectName, EDIT_BRANCH)") String createBranch(@PathVariable String projectName, Model model); @RequestMapping(value="/edit/{projectName:" + DocumentrConstants.PROJECT_NAME_PATTERN + "}/" + "{name:" + DocumentrConstants.BRANCH_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasBranchPermission(#projectName, #name, EDIT_BRANCH)") String createBranch(@PathVariable String projectName, @PathVariable String name, Model model); @RequestMapping(value="/save/{projectName:" + DocumentrConstants.PROJECT_NAME_PATTERN + "}", method=RequestMethod.POST) @PreAuthorize("hasBranchPermission(#form.projectName, #form.name, EDIT_BRANCH)") String saveBranch(@ModelAttribute @Valid BranchForm form, BindingResult bindingResult,
			Authentication authentication); @RequestMapping(value="/delete/{projectName:" + DocumentrConstants.PROJECT_NAME_PATTERN + "}/" + "{name:" + DocumentrConstants.BRANCH_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasProjectPermission(#projectName, EDIT_BRANCH)") String deleteBranch(@PathVariable String projectName, @PathVariable String name,
			Authentication authentication); @ModelAttribute BranchForm createBranchForm(@PathVariable String projectName, @RequestParam(required=false) String name,
			@RequestParam(required=false) String originalName, @RequestParam(required=false) String startingBranch);  }
@Test public void createBranch() { String view = branchController.createBranch(PROJECT, model); assertEquals("/project/branch/edit", view); verify(model).addAttribute(eq("branchForm"), argBranchForm(PROJECT, null, null)); }