AuditService extends EndpointService { public List<Audit> getAuditsForEntity(BigInteger entityId) throws IOException, TokenExpiredException { String requestUrl = RESOURCE + "/entity/" + entityId.toString(); ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null); assertValidResponse(response, requestUrl); return fromJson(response.getResult(), new TypeReference<List<Audit>>() { }); } AuditService(ArgusHttpClient client); List<Audit> getAuditsForEntity(BigInteger entityId); Audit getAudit(BigInteger id);  }
@Test public void testGetAuditsForEntity() throws IOException, TokenExpiredException { try(ArgusService argusService = new ArgusService(getMockedClient("/AuditServiceTest.json"))) { AuditService auditService = argusService.getAuditService(); List<Audit> result = auditService.getAuditsForEntity(BigInteger.ONE); List<Audit> expected = Arrays.asList(new Audit[] { _constructPersistedAudit() }); assertEquals(expected, result); } }