@Test
public void testSubmitNewJobsMakesAliasInfo() throws SQLException {

    prepareDefaultMockAnswers(SELECTIVE_HARVEST_CHANNEL, jobMock, false);
    String originalDomain = "netarkiv.dk";
    String aliasDomain = "netatarkivalias.dk";
    when(jobDAO.getJobAliasInfo(any(Job.class))).thenReturn(
            Arrays.asList(new AliasInfo[] {new AliasInfo("netatarkivalias.dk", "netarkiv.dk", new Date())}));
    jobDispatcher.submitNextNewJob(SELECTIVE_HARVEST_CHANNEL);
    verify(jmsConnection).send(crawlMessageCaptor.capture());
    assertEquals("Should have 1 metadata entry in last received message", 1, crawlMessageCaptor.getValue()
            .getMetadata().size());
    assertEquals(aliasDomain + " is an alias for " + originalDomain + "\n", new String(crawlMessageCaptor
            .getValue().getMetadata().get(0).getData()));
}