JsonEntryData implements EntryData { public String toJsonString() { return this.jsonObject.toString(); } private  JsonEntryData(String id, JSONObject jsonObject); @Override String getValue(String parameterName); @Override void setValue(String parameterName, String value); @Override Map<String, String> asMap(); @Override String getId(); @Override Map<String, String> getParameters(); String toJsonString(); @Override String toString(); static JsonEntryData of(JSONObject jsonObject); static JsonEntryData of(String id, JSONObject jsonObject);  }
@Test @DisplayName("Provides the entry as a JSON String") public void testToJsonString() { JsonEntryData entry = createEntry("param1", "value-A", "param2", "value-B"); assertThat(entry.toJsonString()).isEqualTo("{\"param1\":\"value-A\",\"param2\":\"value-B\"}"); }