### Question:
SecurityRoleFunctionRestController { @RequestMapping(value = SECURITY_ROLE_FUNCTIONS_URI_PREFIX + "/securityRoleNames/{securityRoleName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SECURITY_ROLE_FUNCTIONS_BY_SECURITY_ROLE_GET) public SecurityRoleFunctionKeys getSecurityRoleFunctionsBySecurityRole(@PathVariable("securityRoleName") String securityRoleName) { return securityRoleFunctionService.getSecurityRoleFunctionsBySecurityRole(new SecurityRoleKey(securityRoleName)); }  @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);  }### Answer:
@Test public void testGetSecurityRoleFunctionsBySecurityRole() { SecurityRoleKey securityRoleKey = new SecurityRoleKey(SECURITY_ROLE); SecurityRoleFunctionKeys securityRoleFunctionKeys = new SecurityRoleFunctionKeys(Collections.singletonList(new SecurityRoleFunctionKey(SECURITY_ROLE, SECURITY_FUNCTION))); when(securityRoleFunctionService.getSecurityRoleFunctionsBySecurityRole(securityRoleKey)).thenReturn(securityRoleFunctionKeys); SecurityRoleFunctionKeys result = securityRoleFunctionRestController.getSecurityRoleFunctionsBySecurityRole(SECURITY_ROLE); assertEquals(securityRoleFunctionKeys, result); verify(securityRoleFunctionService).getSecurityRoleFunctionsBySecurityRole(securityRoleKey); verifyNoMoreInteractions(securityRoleFunctionService); }