NamespaceService extends EndpointService { public List<Namespace> getNamespaces() throws IOException, TokenExpiredException { String requestUrl = RESOURCE; ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null); assertValidResponse(response, requestUrl); return fromJson(response.getResult(), new TypeReference<List<Namespace>>() { }); } NamespaceService(ArgusHttpClient client); List<Namespace> getNamespaces(); Namespace createNamespace(Namespace namespace); Namespace updateNamespace(BigInteger id, Namespace namespace); Namespace updateNamespaceMembers(BigInteger id, Set<String> users);  }
@Test public void testGetNamespace() throws IOException, TokenExpiredException { try(ArgusService argusService = new ArgusService(getMockedClient("/NamespaceServiceTest.json"))) { NamespaceService namespaceService = argusService.getNamespaceService(); List<Namespace> result = namespaceService.getNamespaces(); List<Namespace> expected = Arrays.asList(new Namespace[] { _constructPersistedNamespace() }); assertEquals(expected, result); } }