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

    try {
        String workflowName = "test";
        when(metadataDAO.getWorkflowDef(workflowName, 0)).thenReturn(Optional.of(new WorkflowDef()));
        Optional<WorkflowDef> optionalWorkflowDef = metadataMapperService.lookupWorkflowDefinition(workflowName, 0);
        assertTrue(optionalWorkflowDef.isPresent());
        metadataMapperService.lookupWorkflowDefinition(null, 0);
    } catch (ConstraintViolationException ex) {
        Assert.assertEquals(1, ex.getConstraintViolations().size());
        Set<String> messages = getConstraintViolationMessages(ex.getConstraintViolations());
        assertTrue(messages.contains("WorkflowIds list cannot be null."));
    }
}