@Test
public void getMappedTasks_WithoutTaskDef() throws Exception {

    WorkflowTask taskToSchedule = new WorkflowTask();
    taskToSchedule.setType(TaskType.LAMBDA.name());
    taskToSchedule.setScriptExpression("if ($.input.a==1){return {testValue: true}} else{return {testValue: false} }");
    String taskId = IDGenerator.generate();
    WorkflowDef  wd = new WorkflowDef();
    Workflow w = new Workflow();
    w.setWorkflowDefinition(wd);
    TaskMapperContext taskMapperContext = TaskMapperContext.newBuilder()
            .withWorkflowDefinition(wd)
            .withWorkflowInstance(w)
            .withTaskDefinition(null)
            .withTaskToSchedule(taskToSchedule)
            .withRetryCount(0)
            .withTaskId(taskId)
            .build();
    List<Task> mappedTasks = new LambdaTaskMapper(parametersUtils, metadataDAO).getMappedTasks(taskMapperContext);
    assertEquals(1, mappedTasks.size());
    assertNotNull(mappedTasks);
    assertEquals(TaskType.LAMBDA.name(), mappedTasks.get(0).getTaskType());
}