HistoryService extends EndpointService { public List<History> getHistoryForEntity(BigInteger entityId, int limit) throws IOException, TokenExpiredException { String requestUrl = RESOURCE + "/job/" + entityId.toString() + "?limit=" + limit; ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null); assertValidResponse(response, requestUrl); return fromJson(response.getResult(), new TypeReference<List<History>>() { }); } HistoryService(ArgusHttpClient client); List<History> getHistoryForEntity(BigInteger entityId, int limit);  }
@Test public void testGetHistoryForEntity() throws IOException, TokenExpiredException { try(ArgusService argusService = new ArgusService(getMockedClient("/HistoryServiceTest.json"))) { HistoryService historyService = argusService.getHistoryService(); List<History> result = historyService.getHistoryForEntity(BigInteger.ONE, 1); List<History> expected = Arrays.asList(new History[] { _constructPersistedHistory() }); assertEquals(expected, result); } }