UserPrivilegeService extends PrivilegeService { @Override protected ResourceInstance createPrivilegeResource(String privilegeId) { final Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); mapIds.put(Resource.Type.User, StringUtils.lowerCase(userName)); mapIds.put(Resource.Type.UserPrivilege, privilegeId); return createResource(Resource.Type.UserPrivilege, mapIds); } UserPrivilegeService(String userName); @Override Response createPrivilege(String body, HttpHeaders headers, UriInfo ui); @Override Response updatePrivilege(String body, HttpHeaders headers, UriInfo ui,
      String privilegeId); @Override Response updatePrivileges(String body, HttpHeaders headers, UriInfo ui); @Override Response deletePrivilege(HttpHeaders headers, UriInfo ui,
      String privilegeId); @Override Response deletePrivileges(String body, HttpHeaders headers, UriInfo ui);  }
@Test public void testCreatePrivilegeResourcesWithUppercaseUsername() { UserPrivilegeService userPrivilegeService = new UserPrivilegeService("User"); ResourceInstance result = userPrivilegeService.createPrivilegeResource("test"); assertEquals( "user", result.getKeyValueMap().get(Resource.Type.User)); }