@Test(expected=ApplicationException.class)
public void testDuplicate() throws Exception {

    WorkflowDef def = new WorkflowDef();
    def.setName("testDuplicate");
    def.setVersion(1);
    dao.createWorkflowDef(def);
    dao.createWorkflowDef(def);
}