@Test public void taxonRecordUsageTest() { String expected = "{" + "\"id\":\"777\"," + "\"all\":[\"T1\",\"Name\"]," + "\"verbatim\":{\"core\":{\"http: + "\"http: + "\"extensions\":{}}," + "\"gbifClassification\":{\"taxonID\":\"T1\"," + "\"verbatimScientificName\":\"Name\"," + "\"usage\":{\"key\":1," + "\"name\":\"n\"," + "\"rank\":\"ABERRATION\"}," + "\"classification\":[{\"key\":1," + "\"name\":\"Name\"," + "\"rank\":\"CHEMOFORM\"}," + "{\"key\":2," + "\"name\":\"Name2\"," + "\"rank\":\"ABERRATION\"}]" + "," + "\"acceptedUsage\":{\"key\":2," + "\"name\":\"Name2\"," + "\"rank\":\"ABERRATION\"}," + "\"chemoformKey\":1," + "\"chemoform\":\"Name\"," + "\"aberrationKey\":2," + "\"aberration\":\"Name2\"," + "\"classificationPath\":\"_1\"," + "\"taxonKey\":[1,2]}," + "\"created\":\"1970-01-01T00:00\"}"; List<RankedName> rankedNameList = new ArrayList<>(); RankedName name = RankedName.newBuilder().setKey(1).setName("Name").setRank(Rank.CHEMOFORM).build(); RankedName name2 = RankedName.newBuilder().setKey(2).setName("Name2").setRank(Rank.ABERRATION).build(); rankedNameList.add(name); rankedNameList.add(name2); TaxonRecord taxonRecord = TaxonRecord.newBuilder() .setId("777") .setCreated(0L) .setUsage( RankedName.newBuilder().setKey(1).setName("n").setRank(Rank.ABERRATION).build()) .setClassification(rankedNameList) .setAcceptedUsage(name2) .build(); ExtendedRecord extendedRecord = ExtendedRecord.newBuilder() .setId("777") .setCoreTerms( new ImmutableMap.Builder<String, String>() .put(DwcTerm.taxonID.qualifiedName(), "T1") .put(DwcTerm.scientificName.qualifiedName(), "Name") .build()) .build(); String result = GbifJsonConverter.toStringPartialJson(extendedRecord, taxonRecord); assertEquals(expected, result); assertTrue(JsonValidationUtils.isValid(result)); }
public static String toStringPartialJson(SpecificRecordBase... records) { return toPartialJson(records).toString(); }
GbifJsonConverter { public static String toStringPartialJson(SpecificRecordBase... records) { return toPartialJson(records).toString(); } }
GbifJsonConverter { public static String toStringPartialJson(SpecificRecordBase... records) { return toPartialJson(records).toString(); }  }
GbifJsonConverter { public static String toStringPartialJson(SpecificRecordBase... records) { return toPartialJson(records).toString(); }  static ObjectNode toJson(SpecificRecordBase... records); static ObjectNode toPartialJson(SpecificRecordBase... records); static String toStringJson(SpecificRecordBase... records); static String toStringPartialJson(SpecificRecordBase... records); ObjectNode toJson(); @Override String toString(); }
GbifJsonConverter { public static String toStringPartialJson(SpecificRecordBase... records) { return toPartialJson(records).toString(); }  static ObjectNode toJson(SpecificRecordBase... records); static ObjectNode toPartialJson(SpecificRecordBase... records); static String toStringJson(SpecificRecordBase... records); static String toStringPartialJson(SpecificRecordBase... records); ObjectNode toJson(); @Override String toString();  }