@SuppressWarnings("unchecked") @Test public void testUpdateWorkflowOutput() { Workflow workflow = new Workflow(); workflow.setWorkflowDefinition(new WorkflowDef()); deciderService.updateWorkflowOutput(workflow, null); assertNotNull(workflow.getOutput()); assertTrue(workflow.getOutput().isEmpty()); Task task = new Task(); Map<String, Object> taskOutput = new HashMap<>(); taskOutput.put("taskKey", "taskValue"); task.setOutputData(taskOutput); workflow.getTasks().add(task); WorkflowDef workflowDef = new WorkflowDef(); when(metadataDAO.get(anyString(), anyInt())).thenReturn(Optional.of(workflowDef)); deciderService.updateWorkflowOutput(workflow, null); assertNotNull(workflow.getOutput()); assertEquals("taskValue", workflow.getOutput().get("taskKey")); }
workflow = metadataMapperService.populateWorkflowWithDefinitions(workflow); deciderService.updateWorkflowOutput(workflow, null);
workflow = metadataMapperService.populateWorkflowWithDefinitions(workflow); deciderService.updateWorkflowOutput(wf, null);
updateWorkflowOutput(workflow, task); throw new TerminateWorkflowException(task.getReasonForIncompletion(), status, task);
workflow = metadataMapperService.populateWorkflowWithDefinitions(workflow); deciderService.updateWorkflowOutput(workflow, null);
workflow = metadataMapperService.populateWorkflowWithDefinitions(workflow); deciderService.updateWorkflowOutput(wf, null);
updateWorkflowOutput(workflow, task); throw new TerminateWorkflowException(task.getReasonForIncompletion(), status, task);