Skip to content

Commit

Permalink
issue #121 test #20
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmoho committed Jun 11, 2024
1 parent 9d47a6a commit 1c9068d
Showing 1 changed file with 24 additions and 39 deletions.
63 changes: 24 additions & 39 deletions src/test/java/edu/ucsd/sbrg/bigg/annotation/BiGGAnnotationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
// }
// }
//
//

}

0 comments on commit 1c9068d

Please sign in to comment.