@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.getWorkflowDef(anyString(), anyInt())).thenReturn(Optional.of(workflowDef));
    deciderService.updateWorkflowOutput(workflow, null);
    assertNotNull(workflow.getOutput());
    assertEquals("taskValue", workflow.getOutput().get("taskKey"));
}