DefaultFailedMessageRetrier extends FailedMessageRetrierImp { @Override public void addWorkflow(Workflow workflow) throws CoreException { String key = workflow.obtainWorkflowId(); if (getWorkflows().keySet().contains(key)) { log.warn("duplicate workflow ID [" + key + "]"); throw new CoreException("Workflows cannot be uniquely identified"); } log.debug("adding workflow with key [" + key + "]"); getWorkflows().put(key, workflow); }  @Override void addWorkflow(Workflow workflow); @Override void init(); @Override void start(); @Override void stop(); @Override void close(); TimeInterval getShutdownWaitTime(); void setShutdownWaitTime(TimeInterval interval);  }
@Test public void testDuplicateWorkflows() throws Exception { DefaultFailedMessageRetrier dfmr = new DefaultFailedMessageRetrier(); try { dfmr.addWorkflow(createWorkflow("t1")); dfmr.addWorkflow(createWorkflow("t1")); fail("Duplicate workflows should throw an Exception"); } catch (CoreException e) { ; } }