SelectedWorkFlowInfoMessage extends Message<OnlineWorkflowInfo> { @Override public String toJson() { return writeValueAsString(this); } SelectedWorkFlowInfoMessage(OnlineWorkflowInfo workflow); @Override String toJson();  }
@Test public void testToJson() { OnlineWorkflowInfo workflow = new OnlineWorkflowInfo("id"); workflow.setWcaRunning(true); IndexSecurityRulesResultsSynthesis indexesSecurityRulesApplicatio = new IndexSecurityRulesResultsSynthesis("id"); workflow.setSecurityRulesIndexesApplication(indexesSecurityRulesApplicatio); ContingencyStatesActionsSynthesis statesActions = new ContingencyStatesActionsSynthesis("id"); workflow.setStatesActions(statesActions); WorkflowStatusEnum workflowStatusEnum = WorkflowStatusEnum.DONE; workflow.setStatus(workflowStatusEnum); SelectedWorkFlowInfoMessage flowInfoMessage = new SelectedWorkFlowInfoMessage(workflow); assertEquals( "{\"body\":{\"worflowId\":\"id\",\"status\":\"DONE\",\"wcaRunning\":true,\"workStatus\":{},\"statesActions\":{\"contingencyMap\":{},\"workflowId\":\"id\"},\"unsafeContingencies\":null,\"securityRulesIndexesApplication\":{\"workflowId\":\"id\",\"contingencySecurityRulesMap\":{}},\"wcaContingencies\":null},\"type\":\"selectedWorkFlowInfo\"}", flowInfoMessage.toJson()); }