MacroController { @RequestMapping(value="/delete/{name:" + DocumentrConstants.MACRO_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") public String deleteMacro(@PathVariable String name) throws IOException { macroFactory.deleteGroovyMacro(name); return "redirect:/macros"; }  @RequestMapping(value="/create", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") String createMacro(Model model); @RequestMapping(value="/edit/{name:" + DocumentrConstants.MACRO_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") String editMacro(@PathVariable String name, Model model); @RequestMapping(value="/verify/json", method=RequestMethod.POST) @PreAuthorize("hasApplicationPermission(ADMIN)") @ResponseBody Map<String, Object> verifyMacro(@RequestParam String code); @RequestMapping(value="/save", method=RequestMethod.POST) @PreAuthorize("hasApplicationPermission(ADMIN)") String saveMacro(@ModelAttribute @Valid MacroForm form, BindingResult bindingResult); @RequestMapping(value="/delete/{name:" + DocumentrConstants.MACRO_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") String deleteMacro(@PathVariable String name); @ModelAttribute MacroForm createMacroForm(@RequestParam(required=false) String name,
			@RequestParam(required=false) String code);  }
@Test public void deleteMacro() throws IOException { String result = controller.deleteMacro(MACRO); assertEquals("/macros", removeViewPrefix(result)); assertRedirect(result); verify(macroFactory).deleteGroovyMacro(MACRO); }