Skip to content
Snippets Groups Projects
Commit b170037d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

model annotator test fix

parent 523fea44
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
......@@ -109,17 +110,16 @@ public class ModelAnnotatorTest extends AnnotationTestFunctions {
model.addReaction(new Reaction());
Map<Class<?>, List<ElementAnnotator>> annotators = new HashMap<>();
annotators.put(Protein.class, modelAnnotator.getDefaultAnnotators());
annotators.put(Reaction.class, modelAnnotator.getDefaultAnnotators());
List<ElementAnnotator> annotatorList = new ArrayList<>();
annotatorList.addAll(modelAnnotator.getDefaultAnnotators());
annotators.put(Reaction.class, annotatorList);
annotators.put(Protein.class, new ArrayList<>());
ReconAnnotator reconMock = Mockito.mock(ReconAnnotator.class);
Mockito.doThrow(new AnnotatorException("")).when(reconMock).annotateElement(any());
annotators.get(Reaction.class).add(reconMock);
modelAnnotator.annotateModel(model, updater, annotators);
assertTrue(model.getSpeciesBySpeciesId("id1").getMiriamData().size() > 0);
assertTrue(model.getSpeciesBySpeciesId("id2").getMiriamData().size() >= 1);
// check if our mock threw an exception and if this exception is in logs
assertEquals(1, getWarnings().size());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment