From 4a3cf9b29f0b405c9b23875221cf24d36151dc58 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Fri, 28 Oct 2016 16:41:22 +0200 Subject: [PATCH] coverage tests for uniprot connector --- .../annotators/UniprotAnnotatorTest.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/UniprotAnnotatorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/UniprotAnnotatorTest.java index 73b94a64a3..8f7b2edc3b 100644 --- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/UniprotAnnotatorTest.java +++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/UniprotAnnotatorTest.java @@ -2,6 +2,7 @@ package lcsb.mapviewer.annotation.services.annotators; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.Matchers.anyString; @@ -31,7 +32,6 @@ public class UniprotAnnotatorTest extends AnnotationTestFunctions { @Autowired UniprotAnnotator uniprotAnnotator; - @Before public void setUp() throws Exception { } @@ -87,6 +87,28 @@ public class UniprotAnnotatorTest extends AnnotationTestFunctions { } + @Test + public void testInvalidUniprotToHgnc() throws Exception { + try { + assertNull(uniprotAnnotator.uniProtToHgnc(null)); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + @Test + public void testInvalidUniprotToHgnc2() throws Exception { + try { + uniprotAnnotator.uniProtToHgnc(new MiriamData(MiriamType.WIKIPEDIA, "bla")); + fail("Exception expected"); + } catch (InvalidArgumentException e) { + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + @Test public void testAnnotate2() throws Exception { try { -- GitLab