SecurityFunctionRestController { @RequestMapping(value = SECURITY_FUNCTIONS_URI_PREFIX, method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SECURITY_FUNCTIONS_ALL_GET) public SecurityFunctionKeys getSecurityFunctions() { return securityFunctionService.getSecurityFunctions(); }  @RequestMapping(value = SECURITY_FUNCTIONS_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_SECURITY_FUNCTIONS_POST) SecurityFunction createSecurityFunction(@RequestBody SecurityFunctionCreateRequest request); @RequestMapping(value = SECURITY_FUNCTIONS_URI_PREFIX + "/{securityFunctionName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_SECURITY_FUNCTIONS_DELETE) SecurityFunction deleteSecurityFunction(@PathVariable("securityFunctionName") String securityFunctionName); @RequestMapping(value = SECURITY_FUNCTIONS_URI_PREFIX + "/{securityFunctionName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SECURITY_FUNCTIONS_GET) SecurityFunction getSecurityFunction(@PathVariable("securityFunctionName") String securityFunctionName); @RequestMapping(value = SECURITY_FUNCTIONS_URI_PREFIX, method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SECURITY_FUNCTIONS_ALL_GET) SecurityFunctionKeys getSecurityFunctions();  }
@Test public void testGetSecurityFunctions() throws Exception { SecurityFunctionKeys securityFunctionKeys = new SecurityFunctionKeys(Arrays.asList(new SecurityFunctionKey(SECURITY_FUNCTION), new SecurityFunctionKey(SECURITY_FUNCTION_2))); when(securityFunctionService.getSecurityFunctions()).thenReturn(securityFunctionKeys); SecurityFunctionKeys resultSecurityFunctionKeys = securityFunctionRestController.getSecurityFunctions(); verify(securityFunctionService).getSecurityFunctions(); verifyNoMoreInteractions(securityFunctionService); assertEquals(securityFunctionKeys, resultSecurityFunctionKeys); }