@Test
public void getMappedTasks() throws Exception {

    WorkflowTask taskToSchedule = new WorkflowTask();
    taskToSchedule.setType(TaskType.TASK_TYPE_TERMINATE);
    String taskId = IDGenerator.generate();
    WorkflowDef workflowDef = new WorkflowDef();
    Workflow workflow = new Workflow();
    workflow.setWorkflowDefinition(workflowDef);
    TaskMapperContext taskMapperContext = TaskMapperContext.newBuilder()
            .withWorkflowDefinition(workflowDef)
            .withWorkflowInstance(workflow)
            .withTaskDefinition(new TaskDef())
            .withTaskToSchedule(taskToSchedule)
            .withRetryCount(0)
            .withTaskId(taskId)
            .build();
    List<Task> mappedTasks = new TerminateTaskMapper(parametersUtils).getMappedTasks(taskMapperContext);
    Assert.assertNotNull(mappedTasks);
    Assert.assertEquals(1, mappedTasks.size());
    Assert.assertEquals(TaskType.TASK_TYPE_TERMINATE, mappedTasks.get(0).getTaskType());
}