StatusMessage extends Message<StatusSynthesis> { @Override public String toJson() { return writeValueAsString(this); } StatusMessage(StatusSynthesis body); @Override String toJson(); @Override void toJson(JsonGenerator generator); public String type; }
@Test public void testToJson() { WorkflowStatusEnum status = WorkflowStatusEnum.DONE; StatusSynthesis body = new StatusSynthesis("id", status); StatusMessage message = new StatusMessage(body); assertEquals("{\"body\":{\"workflowId\":\"id\",\"status\":\"DONE\"},\"type\":\"status\"}", message.toJson()); }