SecurityRoleRestController { @RequestMapping(value = SECURITY_ROLES_URI_PREFIX, method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SECURITY_ROLES_ALL_GET) public SecurityRoleKeys getSecurityRoles() { return securityRoleService.getSecurityRoles(); }  @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 testGetSecurityRoles() { SecurityRoleKeys securityRoleKeys = new SecurityRoleKeys(Lists.newArrayList(new SecurityRoleKey(SECURITY_ROLE))); when(securityRoleService.getSecurityRoles()).thenReturn(securityRoleKeys); SecurityRoleKeys result = securityRoleRestController.getSecurityRoles(); assertEquals(securityRoleKeys, result); verify(securityRoleService).getSecurityRoles(); verifyNoMoreInteractions(securityRoleService); }