@Test public void testJsonSerialization() throws IOException { InfoMessage msg = new InfoMessage(new FlowStatusResponse( new FlowIdStatusPayload("FLOW", FlowState.UP)), 10L, "CORRELATION", Destination.NORTHBOUND, null); InfoMessage fromJson = MAPPER.readValue(json, InfoMessage.class); FlowStatusResponse fsrJson = (FlowStatusResponse) fromJson.getData(); FlowStatusResponse fsrObj = (FlowStatusResponse) msg.getData(); Assert.assertEquals(fsrJson.getPayload().getId(), fsrObj.getPayload().getId()); Assert.assertEquals(fsrJson.getPayload().getStatus(), fsrObj.getPayload().getStatus()); Assert.assertEquals(fsrJson.getPayload().getStatus(), FlowState.UP); Assert.assertEquals(fromJson.getCorrelationId(), msg.getCorrelationId()); System.out.println("JSON: " + MAPPER.writeValueAsString(msg)); }
public FlowIdStatusPayload getPayload() { return payload; }
FlowStatusResponse extends InfoData { public FlowIdStatusPayload getPayload() { return payload; } }
FlowStatusResponse extends InfoData { public FlowIdStatusPayload getPayload() { return payload; } @JsonCreator  FlowStatusResponse(@JsonProperty(PAYLOAD) final FlowIdStatusPayload payload); }
FlowStatusResponse extends InfoData { public FlowIdStatusPayload getPayload() { return payload; } @JsonCreator  FlowStatusResponse(@JsonProperty(PAYLOAD) final FlowIdStatusPayload payload); FlowIdStatusPayload getPayload(); void setPayload(final FlowIdStatusPayload payload); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object object); }
FlowStatusResponse extends InfoData { public FlowIdStatusPayload getPayload() { return payload; } @JsonCreator  FlowStatusResponse(@JsonProperty(PAYLOAD) final FlowIdStatusPayload payload); FlowIdStatusPayload getPayload(); void setPayload(final FlowIdStatusPayload payload); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object object);  }