Search in sources :

Example 1 with AddAxiomData

use of org.semanticweb.owlapi.change.AddAxiomData in project webprotege by protegeproject.

the class RevisionManagerImpl_TestCase method should_addRevision.

@Test
public void should_addRevision() {
    UserId userId = mock(UserId.class);
    List<OWLOntologyChangeRecord> changes = Arrays.asList(new OWLOntologyChangeRecord(new OWLOntologyID(), new AddAxiomData(mock(OWLAxiom.class))));
    manager.addRevision(userId, changes, HIGHLEVEL_DESC);
    ArgumentCaptor<Revision> revisionCaptor = ArgumentCaptor.forClass(Revision.class);
    verify(revisionStore, times(1)).addRevision(revisionCaptor.capture());
    Revision addedRevision = revisionCaptor.getValue();
    assertThat(addedRevision.getUserId(), is(userId));
    assertThat(addedRevision.getHighLevelDescription(), is(HIGHLEVEL_DESC));
    assertThat(addedRevision.getRevisionNumber(), is(nextRevisionNumber));
}
Also used : OWLOntologyChangeRecord(org.semanticweb.owlapi.change.OWLOntologyChangeRecord) Revision(edu.stanford.bmir.protege.web.server.revision.Revision) UserId(edu.stanford.bmir.protege.web.shared.user.UserId) OWLOntologyID(org.semanticweb.owlapi.model.OWLOntologyID) OWLAxiom(org.semanticweb.owlapi.model.OWLAxiom) AddAxiomData(org.semanticweb.owlapi.change.AddAxiomData) Test(org.junit.Test)

Aggregations

Revision (edu.stanford.bmir.protege.web.server.revision.Revision)1 UserId (edu.stanford.bmir.protege.web.shared.user.UserId)1 Test (org.junit.Test)1 AddAxiomData (org.semanticweb.owlapi.change.AddAxiomData)1 OWLOntologyChangeRecord (org.semanticweb.owlapi.change.OWLOntologyChangeRecord)1 OWLAxiom (org.semanticweb.owlapi.model.OWLAxiom)1 OWLOntologyID (org.semanticweb.owlapi.model.OWLOntologyID)1