SecurityRoleRestController { @RequestMapping(value = SECURITY_ROLES_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_SECURITY_ROLES_POST) public SecurityRole createSecurityRole(@RequestBody SecurityRoleCreateRequest securityRoleCreateRequest) { return securityRoleService.createSecurityRole(securityRoleCreateRequest); }  @RequestMapping(value = SECURITY_ROLES_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_SECURITY_ROLES_POST) SecurityRole createSecurityRole(@RequestBody SecurityRoleCreateRequest securityRoleCreateRequest); @RequestMapping(value = SECURITY_ROLES_URI_PREFIX + "/{securityRoleName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_SECURITY_ROLES_DELETE) SecurityRole deleteSecurityRole(@PathVariable("securityRoleName") String securityRoleName); @RequestMapping(value = SECURITY_ROLES_URI_PREFIX + "/{securityRoleName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SECURITY_ROLES_GET) SecurityRole getSecurityRole(@PathVariable("securityRoleName") String securityRoleName); @RequestMapping(value = SECURITY_ROLES_URI_PREFIX, method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SECURITY_ROLES_ALL_GET) SecurityRoleKeys getSecurityRoles(); @RequestMapping(value = SECURITY_ROLES_URI_PREFIX + "/{securityRoleName}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_SECURITY_ROLES_PUT) SecurityRole updateSecurityRole(@PathVariable("securityRoleName") String securityRoleName,
        @RequestBody SecurityRoleUpdateRequest securityRoleUpdateRequest);  }
@Test public void testCreateSecurityRole() { SecurityRoleCreateRequest securityRoleCreateRequest = new SecurityRoleCreateRequest(SECURITY_ROLE, DESCRIPTION); SecurityRole securityRole = new SecurityRole(SECURITY_ROLE, DESCRIPTION); when(securityRoleService.createSecurityRole(securityRoleCreateRequest)).thenReturn(securityRole); SecurityRole result = securityRoleRestController.createSecurityRole(securityRoleCreateRequest); assertEquals(securityRole, result); verify(securityRoleService).createSecurityRole(securityRoleCreateRequest); verifyNoMoreInteractions(securityRoleService); }