@Test
public void getMappedTasks() throws Exception {

    ParametersUtils parametersUtils = Mockito.mock(ParametersUtils.class);
    EventTaskMapper  eventTaskMapper = new EventTaskMapper(parametersUtils);
    WorkflowTask taskToBeScheduled = new WorkflowTask();
    taskToBeScheduled.setSink("SQSSINK");
    String taskId = IDGenerator.generate();
    Map<String, Object> eventTaskInput = new HashMap<>();
    eventTaskInput.put("sink","SQSSINK");
    when(parametersUtils.getTaskInput(anyMap(), any(Workflow.class), any(TaskDef.class), anyString())).thenReturn(eventTaskInput);
    WorkflowDef  wd = new WorkflowDef();
    Workflow w = new Workflow();
    w.setWorkflowDefinition(wd);
    TaskMapperContext taskMapperContext = TaskMapperContext.newBuilder()
            .withWorkflowDefinition(wd)
            .withWorkflowInstance(w)
            .withTaskDefinition(new TaskDef())
            .withTaskToSchedule(taskToBeScheduled)
            .withRetryCount(0)
            .withTaskId(taskId)
            .build();
    List<Task> mappedTasks = eventTaskMapper.getMappedTasks(taskMapperContext);
    assertEquals(1, mappedTasks.size());
    Task eventTask = mappedTasks.get(0);
    assertEquals(taskId, eventTask.getTaskId());
}