@Test
public void testTaskToDomain() {

    Workflow workflow = generateSampleWorkflow();
    List<Task> tasks = generateSampleTasks(3);
    Map<String, String> taskToDomain = new HashMap<>();
    taskToDomain.put("*", "mydomain");
    workflow.setTaskToDomain(taskToDomain);
    PollData pollData1 = new PollData("queue1", "mydomain", "worker1", System.currentTimeMillis() - 99 * 100);
    when(executionDAOFacade.getTaskPollDataByDomain(anyString(), anyString())).thenReturn(pollData1);
    workflowExecutor.setTaskDomains(tasks, workflow);
    assertNotNull(tasks);
    tasks.forEach(task -> assertEquals("mydomain", task.getDomain()));
}