@Test
public void testMetadataPopulationOnSimpleTask() {

    String nameTaskDefinition = "task1";
    TaskDef taskDefinition = createTaskDefinition(nameTaskDefinition);
    WorkflowTask workflowTask = createWorkflowTask(nameTaskDefinition);
    when(metadataDAO.getTaskDef(nameTaskDefinition)).thenReturn(taskDefinition);
    WorkflowDef workflowDefinition = createWorkflowDefinition("testMetadataPopulation");
    workflowDefinition.setTasks(ImmutableList.of(workflowTask));
    metadataMapperService.populateTaskDefinitions(workflowDefinition);
    assertEquals(1, workflowDefinition.getTasks().size());
    WorkflowTask populatedWorkflowTask = workflowDefinition.getTasks().get(0);
    assertNotNull(populatedWorkflowTask.getTaskDefinition());
    verify(metadataDAO).getTaskDef(nameTaskDefinition);
}