@Test public void formatSourceReportResult() throws IOException { String result = "{\n" + " \"columns\" : [ \"study_citation\", \"study_url\", \"study_doi\", \"study_source_citation\", \"number_of_interactions\", \"number_of_distinct_taxa\", \"number_of_studies\", \"number_of_sources\", \"number_of_distinct_taxa_no_match\", \"study_source_id\", \"study_source_doi\", \"study_source_format\", \"study_source_archive_uri\", \"study_source_last_seen_at\" ],\n" + " \"data\" : [ [ null, null, null, null, 1154, 419, 1, 1, 32, \"globi:millerse/Classified-List-of-Hosts-and-Parasites\", \"https: "}"; ObjectMapper mapper = new ObjectMapper(); String format = new ResultFormatterJSONv2().format(result); JsonNode jsonNode = mapper.readTree(format); assertThat(jsonNode.isArray(), is(true)); JsonNode firstRow = jsonNode.get(0); assertThat(firstRow.get("study_source_id").asText(), is("globi:millerse/Classified-List-of-Hosts-and-Parasites")); assertThat(firstRow.get("study_source_last_seen_at").asText(), is("1489545754794")); }
@Override public String format(String result) throws ResultFormattingException { try { JsonNode jsonNode = RequestHelper.parse(result); return format(jsonNode); } catch (IOException e) { throw new ResultFormattingException("failed to format result", e); } }
ResultFormatterJSONv2 implements ResultFormatter { @Override public String format(String result) throws ResultFormattingException { try { JsonNode jsonNode = RequestHelper.parse(result); return format(jsonNode); } catch (IOException e) { throw new ResultFormattingException("failed to format result", e); } } }
ResultFormatterJSONv2 implements ResultFormatter { @Override public String format(String result) throws ResultFormattingException { try { JsonNode jsonNode = RequestHelper.parse(result); return format(jsonNode); } catch (IOException e) { throw new ResultFormattingException("failed to format result", e); } }  }
ResultFormatterJSONv2 implements ResultFormatter { @Override public String format(String result) throws ResultFormattingException { try { JsonNode jsonNode = RequestHelper.parse(result); return format(jsonNode); } catch (IOException e) { throw new ResultFormattingException("failed to format result", e); } }  @Override String format(String result); }
ResultFormatterJSONv2 implements ResultFormatter { @Override public String format(String result) throws ResultFormattingException { try { JsonNode jsonNode = RequestHelper.parse(result); return format(jsonNode); } catch (IOException e) { throw new ResultFormattingException("failed to format result", e); } }  @Override String format(String result);  }