DdiConfig { public DdiPolling getPolling() { return polling; } DdiConfig(final DdiPolling polling);  DdiConfig(); DdiPolling getPolling();  }
@Test @Description("Verify the correct serialization and deserialization of the model") public void shouldSerializeAndDeserializeObject() throws IOException { DdiPolling ddiPolling = new DdiPolling("10"); DdiConfig ddiConfig = new DdiConfig(ddiPolling); String serializedDdiConfig = mapper.writeValueAsString(ddiConfig); DdiConfig deserializedDdiConfig = mapper.readValue(serializedDdiConfig, DdiConfig.class); assertThat(serializedDdiConfig).contains("10"); assertThat(deserializedDdiConfig.getPolling().getSleep()).isEqualTo("10"); }
@Test @Description("Verify the correct deserialization of a model with a additional unknown property") public void shouldDeserializeObjectWithUnknownProperty() throws IOException { String serializedDdiConfig = "{\"polling\":{\"sleep\":\"123\"},\"unknownProperty\":\"test\"}"; DdiConfig ddiConfig = mapper.readValue(serializedDdiConfig, DdiConfig.class); assertThat(ddiConfig.getPolling().getSleep()).isEqualTo("123"); }