SecurityRoleFunctionRestController { @RequestMapping(value = SECURITY_ROLE_FUNCTIONS_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_SECURITY_ROLE_FUNCTIONS_POST) public SecurityRoleFunction createSecurityRoleFunction(@RequestBody SecurityRoleFunctionCreateRequest securityRoleFunctionCreateRequest) { return securityRoleFunctionService.createSecurityRoleFunction(securityRoleFunctionCreateRequest); }  @RequestMapping(value = SECURITY_ROLE_FUNCTIONS_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_SECURITY_ROLE_FUNCTIONS_POST) SecurityRoleFunction createSecurityRoleFunction(@RequestBody SecurityRoleFunctionCreateRequest securityRoleFunctionCreateRequest); @RequestMapping(value = SECURITY_ROLE_FUNCTIONS_URI_PREFIX + "/securityRoleNames/{securityRoleName}/securityFunctionNames/{securityFunctionName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_SECURITY_ROLE_FUNCTIONS_DELETE) SecurityRoleFunction deleteSecurityRoleFunction(@PathVariable("securityRoleName") String securityRoleName,
        @PathVariable("securityFunctionName") String securityFunctionName); @RequestMapping(value = SECURITY_ROLE_FUNCTIONS_URI_PREFIX + "/securityRoleNames/{securityRoleName}/securityFunctionNames/{securityFunctionName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SECURITY_ROLE_FUNCTIONS_GET) SecurityRoleFunction getSecurityRoleFunction(@PathVariable("securityRoleName") String securityRoleName,
        @PathVariable("securityFunctionName") String securityFunctionName); @RequestMapping(value = SECURITY_ROLE_FUNCTIONS_URI_PREFIX, method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SECURITY_ROLE_FUNCTIONS_ALL_GET) SecurityRoleFunctionKeys getSecurityRoleFunctions(); @RequestMapping(value = SECURITY_ROLE_FUNCTIONS_URI_PREFIX + "/securityFunctionNames/{securityFunctionName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SECURITY_ROLE_FUNCTIONS_BY_SECURITY_FUNCTION_GET) SecurityRoleFunctionKeys getSecurityRoleFunctionsBySecurityFunction(@PathVariable("securityFunctionName") String securityFunctionName); @RequestMapping(value = SECURITY_ROLE_FUNCTIONS_URI_PREFIX + "/securityRoleNames/{securityRoleName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SECURITY_ROLE_FUNCTIONS_BY_SECURITY_ROLE_GET) SecurityRoleFunctionKeys getSecurityRoleFunctionsBySecurityRole(@PathVariable("securityRoleName") String securityRoleName);  }
@Test public void testCreateSecurityRoleFunction() { SecurityRoleFunctionCreateRequest securityRoleFunctionCreateRequest = new SecurityRoleFunctionCreateRequest(new SecurityRoleFunctionKey(SECURITY_ROLE, SECURITY_FUNCTION)); SecurityRoleFunction securityRoleFunction = new SecurityRoleFunction(ID, new SecurityRoleFunctionKey(SECURITY_ROLE, SECURITY_FUNCTION)); when(securityRoleFunctionService.createSecurityRoleFunction(securityRoleFunctionCreateRequest)).thenReturn(securityRoleFunction); SecurityRoleFunction result = securityRoleFunctionRestController.createSecurityRoleFunction(securityRoleFunctionCreateRequest); assertEquals(securityRoleFunction, result); verify(securityRoleFunctionService).createSecurityRoleFunction(securityRoleFunctionCreateRequest); verifyNoMoreInteractions(securityRoleFunctionService); }