From 1c9068ddd807250f3dfb7119d656a4369a0ec6ff Mon Sep 17 00:00:00 2001 From: Schmoho Date: Tue, 2 Aug 2022 13:40:05 +0200 Subject: [PATCH] issue #121 test #20 --- .../bigg/annotation/BiGGAnnotationTest.java | 63 +++++++------------ 1 file changed, 24 insertions(+), 39 deletions(-) diff --git a/src/test/java/edu/ucsd/sbrg/bigg/annotation/BiGGAnnotationTest.java b/src/test/java/edu/ucsd/sbrg/bigg/annotation/BiGGAnnotationTest.java index 30737400..1d86c912 100644 --- a/src/test/java/edu/ucsd/sbrg/bigg/annotation/BiGGAnnotationTest.java +++ b/src/test/java/edu/ucsd/sbrg/bigg/annotation/BiGGAnnotationTest.java @@ -10,48 +10,33 @@ import static edu.ucsd.sbrg.TestUtils.assertCVTermIsPresent; import static edu.ucsd.sbrg.TestUtils.initParameters; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; public class BiGGAnnotationTest extends BiGGDBTest { - @Test - public void annotatePublication() { - initParameters(Map.of( - ModelPolisherOptions.ANNOTATE_WITH_BIGG.getOptionName(), - "true", - ModelPolisherOptions.INCLUDE_ANY_URI.getOptionName(), - "true")); - var sbml = new SBMLDocument(3, 2); - var m = new Model("iJO1366", 3,2); - sbml.setModel(m); - var annotater = new BiGGAnnotation(); - - assertFalse(m.isSetMetaId()); - assertTrue(m.getCVTerms().isEmpty()); - - annotater.annotate(sbml); - - assertTrue(m.isSetMetaId()); - assertCVTermIsPresent(m, - CVTerm.Type.MODEL_QUALIFIER, - CVTerm.Qualifier.BQM_IS_DESCRIBED_BY, - "https://identifiers.org/pubmed/21988831", - "Expected pubmed publication reference 21988831 not present on the model."); + @Test + public void annotatePublication() { + initParameters(Map.of( + ModelPolisherOptions.ANNOTATE_WITH_BIGG.getOptionName(), + "true", + ModelPolisherOptions.INCLUDE_ANY_URI.getOptionName(), + "true")); + var sbml = new SBMLDocument(3, 2); + var m = new Model("iJO1366", 3, 2); + sbml.setModel(m); + var annotater = new BiGGAnnotation(); + + assertFalse(m.isSetMetaId()); + assertTrue(m.getCVTerms().isEmpty()); + + annotater.annotate(sbml); + + assertTrue(m.isSetMetaId()); + assertCVTermIsPresent(m, + CVTerm.Type.MODEL_QUALIFIER, + CVTerm.Qualifier.BQM_IS_DESCRIBED_BY, + "https://identifiers.org/pubmed/21988831", + "Expected pubmed publication reference 21988831 not present on the model."); } -// @Test -// public void getBiGGIdFromResourcesTest() { -// for (Species species : doc.getModel().getListOfSpecies()) { -// Species obfuscated = species.clone(); -// obfuscated.setId("random"); -// BiGGAnnotation biGGAnnotation = new BiGGAnnotation(); -// String originalId = biGGAnnotation.checkId(species).map(BiGGId::toBiGGId).get(); -// String obfuscatedId = biGGAnnotation.checkId(species).map(BiGGId::toBiGGId).get(); -// assertEquals(originalId, obfuscatedId); -// } -// } -// -// - }