@Test
public void getDynamicTaskDefinitionNull() {

    //Given
    WorkflowTask workflowTask = new WorkflowTask();
    workflowTask.setName("Foo");
    expectedException.expect(TerminateWorkflowException.class);
    expectedException.expectMessage(String.format("Invalid task specified.  Cannot find task by name %s in the task definitions",
            workflowTask.getName()));
    dynamicTaskMapper.getDynamicTaskDefinition(workflowTask);
}