@Test public void multimediaRecordTest() { String expected = "{\"id\":\"777\"," + "\"multimediaItems\":[{\"type\":\"StillImage\"," + "\"format\":\"image/jpeg\"," + "\"license\":\"somelicense\"}," + "{\"type\":\"MovingImage\"," + "\"format\":\"video/mp4\"," + "\"license\":\"somelicense\"}]," + "\"mediaTypes\":[\"StillImage\",\"MovingImage\"]," + "\"mediaLicenses\":[\"somelicense\"]}"; Multimedia stillImage = new Multimedia(); stillImage.setType(MediaType.StillImage.name()); stillImage.setFormat("image/jpeg"); stillImage.setLicense("somelicense"); Multimedia movingImage = new Multimedia(); movingImage.setType(MediaType.MovingImage.name()); movingImage.setFormat("video/mp4"); movingImage.setLicense("somelicense"); MultimediaRecord multimediaRecord = MultimediaRecord.newBuilder() .setId("777") .setMultimediaItems(Arrays.asList(stillImage, movingImage)) .build(); String result = GbifJsonConverter.toStringPartialJson(multimediaRecord); 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();  }