@Test(expected = IllegalArgumentException.class)
public void testLookupLatestWorkflowDefinition() {

    String workflowName = "test";
    when(metadataDAO.getLatestWorkflowDef(workflowName)).thenReturn(Optional.of(new WorkflowDef()));
    Optional<WorkflowDef> optionalWorkflowDef = metadataMapperService.lookupLatestWorkflowDefinition(workflowName);
    assertTrue(optionalWorkflowDef.isPresent());
    metadataMapperService.lookupLatestWorkflowDefinition(null);
}