### Question:
QaReportController { @GET @Path("/resources") public Response qaReportResources() { return JaxRsUtils.buildStreamingResponse(factory, new StreamingJsonResponse() { @Override public void write(final JsonGenerator json) throws IOException { final CassandraFrameworkProtos.CassandraClusterState clusterState = cluster.getClusterState().get(); json.writeObjectFieldStart("nodes"); for (final CassandraFrameworkProtos.CassandraNode cassandraNode : clusterState.getNodesList()) { if (!cassandraNode.hasCassandraNodeExecutor()) { continue; } final CassandraFrameworkProtos.ExecutorMetadata executorMetadata = cluster.metadataForExecutor(cassandraNode.getCassandraNodeExecutor().getExecutorId()); if (executorMetadata == null) { continue; } json.writeObjectFieldStart(cassandraNode.getCassandraNodeExecutor().getExecutorId()); final String workdir = executorMetadata.getWorkdir(); json.writeStringField("workdir", workdir); json.writeStringField("slaveBaseUri", "http: json.writeStringField("ip", cassandraNode.getIp()); json.writeStringField("hostname", cassandraNode.getHostname()); json.writeStringField("targetRunState", cassandraNode.getTargetRunState().name()); json.writeStringField("jmxIp", cassandraNode.getJmxConnect().getIp()); json.writeNumberField("jmxPort", cassandraNode.getJmxConnect().getJmxPort()); json.writeBooleanField("live", cluster.isLiveNode(cassandraNode)); json.writeArrayFieldStart("logfiles"); for (final String logFile : cluster.getNodeLogFiles(cassandraNode)) { json.writeString(logFile); } json.writeEndArray(); json.writeEndObject(); } json.writeEndObject(); } }); } QaReportController(@NotNull final CassandraCluster cluster, @NotNull final JsonFactory factory); @GET @Path("/resources") @Produces("text/plain") Response qaReportResourcesText(); @GET @Path("/resources") Response qaReportResources();  }### Answer:
@Test public void testQaReportResources() throws Exception { threeNodeCluster(); final Tuple2<Integer, JsonNode> tup = fetchJson("/qa/report/resources", false); assertEquals(200, tup._1.intValue()); final JsonNode json = tup._2; for (int i = 0; i < activeNodes; i++) { final Tuple2<Protos.SlaveID, String> slave = slaves[i]; final JsonNode node = json.get("nodes").get(executorMetadata[i].getExecutor().getExecutorId().getValue()); assertEquals(slave._2, node.get("ip").asText()); assertTrue(node.has("workdir")); assertTrue(node.has("hostname")); assertTrue(node.has("targetRunState")); assertTrue(node.has("jmxIp")); assertTrue(node.has("jmxPort")); assertTrue(node.has("live")); assertTrue(node.get("logfiles").isArray()); assertEquals(2, node.get("logfiles").size()); } }