PermissionController { @RequestMapping(value = "/permissions/{permissionName}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) public void deletePermission(@PathVariable String permissionName) { motechPermissionService.deletePermission(permissionName); }  @RequestMapping(value = "/permissions", method = RequestMethod.GET) @ResponseBody List<PermissionDto> getPermissions(); @PreAuthorize(WebSecurityRoles.HAS_MANAGE_ROLE_AND_PERMISSION) @RequestMapping(value = "/permissions/{permissionName}", method = RequestMethod.POST) @ResponseStatus(HttpStatus.OK) void savePermission(@PathVariable String permissionName); @RequestMapping(value = "/permissions/{permissionName}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) void deletePermission(@PathVariable String permissionName); @Autowired void setMotechPermissionService(MotechPermissionService motechPermissionService);  }
@Test public void shouldRemovePermissions() throws Exception { controller.perform( delete("/web-api/permissions/testName") ).andExpect( status().is(HttpStatus.OK.value()) ); verify(permissionService).deletePermission("testName"); }