NutrientLevels implements Serializable { @Override public String toString() { return "NutrientLevels{" + "salt='" + salt + '\'' + ", fat='" + fat + '\'' + ", sugars='" + sugars + '\'' + ", saturatedFat='" + saturatedFat + '\'' + ", additionalProperties=" + additionalProperties + '}'; }  NutrimentLevel getSalt(); void setSalt(NutrimentLevel salt); NutrimentLevel getFat(); void setFat(NutrimentLevel fat); NutrimentLevel getSugars(); void setSugars(NutrimentLevel sugars); NutrimentLevel getSaturatedFat(); void setSaturatedFat(NutrimentLevel saturatedFat); @JsonAnyGetter Map<String, Object> getAdditionalProperties(); @JsonAnySetter void setAdditionalProperty(String name, Object value); @Override String toString();  }
@Test public void jsonSerialization_ok() { JsonNode jsonNode = new ObjectMapper().valueToTree(nutrientLevels); assertThat(jsonNode.get("fat").asText()).isEqualTo(NutrimentLevel.LOW.toString()); assertThat(jsonNode.get("salt").asText()).isEqualTo(NutrimentLevel.MODERATE.toString()); assertThat(jsonNode.get("saturated-fat").asText()).isEqualTo(NutrimentLevel.HIGH.toString()); assertThat(jsonNode.get("sugars").asText()).isEqualTo(NutrimentLevel.MODERATE.toString()); }