UserService extends EndpointService { public PrincipalUser getUser(BigInteger id) throws IOException, TokenExpiredException { String requestUrl = RESOURCE + "/id/" + id.toString(); ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null); assertValidResponse(response, requestUrl); return fromJson(response.getResult(), PrincipalUser.class); } UserService(ArgusHttpClient client); PrincipalUser getUser(BigInteger id); PrincipalUser getUser(String username);  }
@Test public void testGetUserById() throws IOException, TokenExpiredException { try(ArgusService argusService = new ArgusService(getMockedClient("/UserServiceTest.json"))) { UserService userService = argusService.getUserService(); PrincipalUser result = userService.getUser(BigInteger.ONE); PrincipalUser expected = _constructAdminUser(); assertEquals(expected, result); } }
@Test public void testGetUserByUsername() throws IOException, TokenExpiredException { try(ArgusService argusService = new ArgusService(getMockedClient("/UserServiceTest.json"))) { UserService userService = argusService.getUserService(); PrincipalUser result = userService.getUser("admin"); PrincipalUser expected = _constructAdminUser(); assertEquals(expected, result); } }