Source:
public void testCaches() throws Exception { String accept = "text/plain; q=0.9, application/json; q=0.6"; String url = String.format("http://localhost:%d/rest/v2/cache-managers/default/caches", restServer().getPort()); ContentResponse response = client.newRequest(url).header("Accept", accept).send(); ResponseAssertion.assertThat(response).isOk(); String json = response.getContentAsString(); JsonNode jsonNode = mapper.readTree(json); List<String> names = asText(jsonNode.findValues("name")); assertEquals("CacheManagerResourceTest", names.get(0)); assertEquals("___protobuf_metadata", names.get(1)); assertEquals("___script_cache", names.get(2)); assertEquals("cache1", names.get(3)); assertEquals("cache2", names.get(4)); List<String> status = asText(jsonNode.findValues("status")); assertTrue(status.contains("RUNNING")); List<String> types = asText(jsonNode.findValues("type")); assertTrue(types.contains("local-cache")); assertTrue(types.contains("distributed-cache")); List<String> simpleCaches = asText(jsonNode.findValues("simple_cache")); assertTrue(simpleCaches.contains("false")); List<String> transactional = asText(jsonNode.findValues("transactional")); assertTrue(transactional.contains("false")); List<String> persistent = asText(jsonNode.findValues("persistent")); assertTrue(persistent.contains("false")); List<String> bounded = asText(jsonNode.findValues("bounded")); assertTrue(bounded.contains("false")); List<String> secured = asText(jsonNode.findValues("secured")); assertTrue(secured.contains("false")); List<String> indexed = asText(jsonNode.findValues("indexed")); assertTrue(indexed.contains("false")); List<String> hasRemoteBackup = asText(jsonNode.findValues("has_remote_backup")); assertTrue(hasRemoteBackup.contains("false")); List<String> heath = asText(jsonNode.findValues("health")); assertTrue(heath.contains("HEALTHY")); }

Target:
public void testCaches() throws Exception { String accept = "text/plain; q=0.9, application/json; q=0.6"; String url = String.format("http://localhost:%d/rest/v2/cache-managers/default/caches", restServer().getPort()); ContentResponse response = client.newRequest(url).header("Accept", accept).send(); ResponseAssertion.assertThat(response).isOk(); String json = response.getContentAsString(); JsonNode jsonNode = mapper.readTree(json); List<String> names = asText(jsonNode.findValues("name")); assertEquals("CacheManagerResourceTest", names.get(0)); assertEquals("___protobuf_metadata", names.get(1)); assertEquals("___script_cache", names.get(2)); assertEquals("cache1", names.get(3)); assertEquals("cache2", names.get(4)); List<String> status = asText(jsonNode.findValues("status")); assertTrue(status.contains("RUNNING")); List<String> types = asText(jsonNode.findValues("type")); assertTrue(types.contains("local-cache")); assertTrue(types.contains("distributed-cache")); List<String> simpleCaches = asText(jsonNode.findValues("simple_cache")); assertTrue(simpleCaches.contains("false")); List<String> transactional = asText(jsonNode.findValues("transactional")); assertTrue(transactional.contains("false")); List<String> persistent = asText(jsonNode.findValues("persistent")); assertTrue(persistent.contains("false")); List<String> bounded = asText(jsonNode.findValues("bounded")); assertTrue(bounded.contains("false")); List<String> secured = asText(jsonNode.findValues("secured")); assertTrue(secured.contains("false")); List<String> indexed = asText(jsonNode.findValues("indexed")); assertTrue(indexed.contains("false")); List<String> hasRemoteBackup = asText(jsonNode.findValues("has_remote_backup")); assertTrue(hasRemoteBackup.contains("false")); List<String> health = asText(jsonNode.findValues("health")); assertTrue(health.contains("HEALTHY")); }