@Test
public void testCorrelateTaskToWorkflowInDS() {

    String workflowId = "workflowId";
    String taskId = "taskId1";
    String taskDefName = "task1";
    TaskDef def = new TaskDef();
    def.setName("task1");
    def.setConcurrentExecLimit(1);
    Task task = new Task();
    task.setTaskId(taskId);
    task.setWorkflowInstanceId(workflowId);
    task.setReferenceTaskName("ref_name");
    task.setTaskDefName(taskDefName);
    task.setTaskType(taskDefName);
    task.setStatus(Status.IN_PROGRESS);
    List<Task> tasks = executionDAO.createTasks(Collections.singletonList(task));
    assertNotNull(tasks);
    assertEquals(1, tasks.size());
    executionDAO.correlateTaskToWorkflowInDS(taskId, workflowId);
    tasks = executionDAO.getTasksForWorkflow(workflowId);
    assertNotNull(tasks);
    assertEquals(workflowId, tasks.get(0).getWorkflowInstanceId());
    assertEquals(taskId, tasks.get(0).getTaskId());
}