@Test public void nonEmptyData() throws IOException { String response = "{\"columns\":[\"source_taxon_external_id\",\"source_taxon_name\",\"source_taxon_path\",\"source_specimen_life_stage\",\"source_specimen_basis_of_record\",\"interaction_type\",\"target_taxon_external_id\",\"target_taxon_name\",\"target_taxon_path\",\"target_specimen_life_stage\",\"target_specimen_basis_of_record\",\"latitude\",\"longitude\",\"study_title\"],\"data\":[[\"EOL_V2:328629\",\"Phoca vitulina\",\"Animalia | Chordata | Mammalia | Carnivora | Phocidae | Phoca | Phoca vitulina\",null,\"PreservedSpecimen\",\"hasParasite\",\"EOL:2857069\",\"Ascarididae\",\"Animalia | Nematoda | Secernentea | Ascaridida | Ascarididae\",null,\"PreservedSpecimen\",null,null,\"http: assertThat(RequestHelper.nonEmptyData(response), Is.is(true)); }
public static boolean nonEmptyData(String body) throws IOException { JsonNode result = parse(body); boolean nonEmpty = false; if (result.has("data")) { JsonNode data = result.get("data"); if (data.isArray() && data.size() > 0) { nonEmpty = true; } } return nonEmpty; }
RequestHelper { public static boolean nonEmptyData(String body) throws IOException { JsonNode result = parse(body); boolean nonEmpty = false; if (result.has("data")) { JsonNode data = result.get("data"); if (data.isArray() && data.size() > 0) { nonEmpty = true; } } return nonEmpty; } }
RequestHelper { public static boolean nonEmptyData(String body) throws IOException { JsonNode result = parse(body); boolean nonEmpty = false; if (result.has("data")) { JsonNode data = result.get("data"); if (data.isArray() && data.size() > 0) { nonEmpty = true; } } return nonEmpty; }  }
RequestHelper { public static boolean nonEmptyData(String body) throws IOException { JsonNode result = parse(body); boolean nonEmpty = false; if (result.has("data")) { JsonNode data = result.get("data"); if (data.isArray() && data.size() > 0) { nonEmpty = true; } } return nonEmpty; }  static boolean isSpatialSearch(Map<String, String[]> parameterMap); static List<LatLng> parseSpatialSearchParams(Map<String, String[]> parameterMap); static void appendSpatialClauses(Map<String, String[]> paramMap, StringBuilder query, QueryType queryType); static void addSpatialClause(List<LatLng> points, StringBuilder query, QueryType queryType); static void addSpatialWhereClause(List<LatLng> points, StringBuilder query); static JsonNode parse(String content); static boolean emptyData(String body); static boolean nonEmptyData(String body); }
RequestHelper { public static boolean nonEmptyData(String body) throws IOException { JsonNode result = parse(body); boolean nonEmpty = false; if (result.has("data")) { JsonNode data = result.get("data"); if (data.isArray() && data.size() > 0) { nonEmpty = true; } } return nonEmpty; }  static boolean isSpatialSearch(Map<String, String[]> parameterMap); static List<LatLng> parseSpatialSearchParams(Map<String, String[]> parameterMap); static void appendSpatialClauses(Map<String, String[]> paramMap, StringBuilder query, QueryType queryType); static void addSpatialClause(List<LatLng> points, StringBuilder query, QueryType queryType); static void addSpatialWhereClause(List<LatLng> points, StringBuilder query); static JsonNode parse(String content); static boolean emptyData(String body); static boolean nonEmptyData(String body); static final String BOUNDING_BOX_PARAMETER_NAME; static final String GEOMETRY_PARAMETER; }