@Test public void shouldSerializeParameterMetadataWithoutEntriesToJSON() { Level[] levels = new Level[]{ level().withName("level1").build(), level().withName("level2").build() }; ParameterEntry[] entries = new ParameterEntry[]{ parameterEntry().withLevels("1").build() }; Parameter parameter = parameter().withName("parameter").withInputLevels(3) .withLevels(levels).withEntries(entries) .build(); StringWriter output = new StringWriter(); serializer.serialize(parameter, output); output.flush(); assertThat(output.toString()).isNotEmpty().contains("levels").contains("parameter") .doesNotContain("entries"); }
@Override public void serialize(Parameter parameter, Writer writer) { gson.toJson(new DeserializedParameter(parameter), writer); }
JsonParameterMetadataSerializer implements ParameterMetadataSerializer { @Override public void serialize(Parameter parameter, Writer writer) { gson.toJson(new DeserializedParameter(parameter), writer); } }
JsonParameterMetadataSerializer implements ParameterMetadataSerializer { @Override public void serialize(Parameter parameter, Writer writer) { gson.toJson(new DeserializedParameter(parameter), writer); } JsonParameterMetadataSerializer(); }
JsonParameterMetadataSerializer implements ParameterMetadataSerializer { @Override public void serialize(Parameter parameter, Writer writer) { gson.toJson(new DeserializedParameter(parameter), writer); } JsonParameterMetadataSerializer(); @Override void serialize(Parameter parameter, Writer writer); }
JsonParameterMetadataSerializer implements ParameterMetadataSerializer { @Override public void serialize(Parameter parameter, Writer writer) { gson.toJson(new DeserializedParameter(parameter), writer); } JsonParameterMetadataSerializer(); @Override void serialize(Parameter parameter, Writer writer);  }