DdiCancelActionToStop { public String getStopId() { return stopId; } @JsonCreator  DdiCancelActionToStop(@JsonProperty("stopId") final String stopId); String getStopId(); @Override String toString();  }
@Test @Description("Verify the correct serialization and deserialization of the model") public void shouldSerializeAndDeserializeObject() throws IOException { String stopId = "1234"; DdiCancelActionToStop ddiCancelActionToStop = new DdiCancelActionToStop(stopId); String serializedDdiCancelActionToStop = mapper.writeValueAsString(ddiCancelActionToStop); DdiCancelActionToStop deserializedDdiCancelActionToStop = mapper.readValue(serializedDdiCancelActionToStop, DdiCancelActionToStop.class); assertThat(serializedDdiCancelActionToStop).contains(stopId); assertThat(deserializedDdiCancelActionToStop.getStopId()).isEqualTo(stopId); }
@Test @Description("Verify the correct deserialization of a model with a additional unknown property") public void shouldDeserializeObjectWithUnknownProperty() throws IOException { String serializedDdiCancelActionToStop = "{\"stopId\":\"12345\",\"unknownProperty\":\"test\"}"; DdiCancelActionToStop ddiCancelActionToStop = mapper.readValue(serializedDdiCancelActionToStop, DdiCancelActionToStop.class); assertThat(ddiCancelActionToStop.getStopId()).contains("12345"); }