@Test
public void testSubmitNewJobsMakesDuplicateReductionInfo() throws DocumentException {

    prepareDefaultMockAnswers(SELECTIVE_HARVEST_CHANNEL, jobMock, true);
    // FIXME Which is correct? Does this fail currently?
    // when(jobMock.getOrderXMLdoc()).thenReturn(doc);
    List<Long> jobIDsForDuplicateReduction = Arrays.asList(new Long[] {1L});
    when(jobDAO.getJobIDsForDuplicateReduction(jobMock.getJobID())).thenReturn(jobIDsForDuplicateReduction);
    jobDispatcher.submitNextNewJob(SELECTIVE_HARVEST_CHANNEL);
    verify(jmsConnection).send(crawlMessageCaptor.capture());
    DoOneCrawlMessage crawlMessage = crawlMessageCaptor.getValue();
    assertEquals("Should have 1 metadata entry in the crawl request", 1, crawlMessage.getMetadata().size());
    MetadataEntry metadataEntry = crawlMessage.getMetadata().get(0);
    assertNotNull("Should have 1 metadata entry", metadataEntry);
    assertEquals("Should have mimetype text/plain", "text/plain", metadataEntry.getMimeType());
    assertEquals("Should have right url",
            "metadata://netarkivet.dk/crawl/setup/duplicatereductionjobs" + "?majorversion=1" + "&minorversion=0"
                    + "&harvestid=" + harvest.getOid() + "&harvestnum=" + jobMock.getHarvestNum() + "&jobid="
                    + jobMock.getJobID(), metadataEntry.getURL());
    assertEquals("Should have right data", jobIDsForDuplicateReduction.get(0) + "",
            new String(metadataEntry.getData()));
}