use of org.molgenis.jobs.JobExecutionException in project molgenis by molgenis.
the class AnnotationJobTest method testFirstAnnotatorFails.
@Test
public void testFirstAnnotatorFails() throws IOException {
when(exac.getSimpleName()).thenReturn("exac");
when(cadd.getSimpleName()).thenReturn("cadd");
AnnotationException exception = new AnnotationException(mock(AnnotationException.class));
doThrow(exception).when(crudRepositoryAnnotator).annotate(exac, repository);
try {
annotationJob.call();
fail("Should throw exception");
} catch (JobExecutionException actual) {
assertEquals(actual.getCause(), exception);
}
Mockito.verify(progress).start();
Mockito.verify(progress).setProgressMax(2);
Mockito.verify(progress).progress(0, "Annotating \"My repo\" with exac (annotator 1 of 2, started by \"fdlk\")");
Mockito.verify(progress).progress(1, "Annotating \"My repo\" with cadd (annotator 2 of 2, started by \"fdlk\")");
Mockito.verify(progress).status("Failed annotators: exac. Successful annotators: cadd");
Mockito.verify(progress).failed(exception);
}
Aggregations