DdiControllerBase extends ResourceSupport { public DdiConfig getConfig() { return config; } DdiControllerBase(final DdiConfig config);  DdiControllerBase(); DdiConfig getConfig();  }
@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); DdiControllerBase ddiControllerBase = new DdiControllerBase(ddiConfig); String serializedDdiControllerBase = mapper.writeValueAsString(ddiControllerBase); DdiControllerBase deserializedDdiControllerBase = mapper.readValue(serializedDdiControllerBase, DdiControllerBase.class); assertThat(serializedDdiControllerBase).contains(ddiPolling.getSleep()); assertThat(deserializedDdiControllerBase.getConfig().getPolling().getSleep()).isEqualTo(ddiPolling.getSleep()); }
@Test @Description("Verify the correct deserialization of a model with a additional unknown property") public void shouldDeserializeObjectWithUnknownProperty() throws IOException { String serializedDdiControllerBase = "{\"config\":{\"polling\":{\"sleep\":\"123\"}},\"links\":[],\"unknownProperty\":\"test\"}"; DdiControllerBase ddiControllerBase = mapper.readValue(serializedDdiControllerBase, DdiControllerBase.class); assertThat(ddiControllerBase.getConfig().getPolling().getSleep()).isEqualTo("123"); }