@Test
public void testCreateCommit() throws Exception {

    // Setup:
    IRI provGenerated = VALUE_FACTORY.createIRI(Activity.generated_IRI);
    IRI provAtTime = VALUE_FACTORY.createIRI(InstantaneousEvent.atTime_IRI);
    IRI provWasAssociatedWith = VALUE_FACTORY.createIRI(Activity.wasAssociatedWith_IRI);
    IRI revisionId = VALUE_FACTORY.createIRI("http://mobi.com/revisions#test");
    Resource generation = VALUE_FACTORY.createIRI("http://mobi.com/test");
    Resource generation2 = VALUE_FACTORY.createIRI("http://mobi.com/test2");
    Commit base = commitFactory.createNew(COMMIT_IRI);
    base.setProperty(generation, provGenerated);
    Commit auxiliary = commitFactory.createNew(COMMIT_IRI);
    auxiliary.setProperty(generation2, provGenerated);
    InProgressCommit inProgressCommit = inProgressCommitFactory.createNew(IN_PROGRESS_COMMIT_IRI);
    inProgressCommit.setProperty(VALUE_FACTORY.createIRI("http://mobi.com/user"), provWasAssociatedWith);
    inProgressCommit.setProperty(revisionId, provGenerated);
    Revision revision = revisionFactory.createNew(revisionId);
    inProgressCommit.getModel().addAll(revision.getModel());
    Commit result = manager.createCommit(inProgressCommit, "message", null, null);
    assertTrue(result.getProperty(provAtTime).isPresent());
    assertEquals("message", result.getProperty(titleIRI).get().stringValue());
    assertFalse(result.getBaseCommit().isPresent());
    assertFalse(result.getAuxiliaryCommit().isPresent());
    assertFalse(result.getModel().contains(IN_PROGRESS_COMMIT_IRI, null, null));
    assertTrue(result.getModel().contains(revisionId, null, null));
    result = manager.createCommit(inProgressCommit, "message", base, auxiliary);
    assertTrue(result.getProperty(provAtTime).isPresent());
    assertEquals("message", result.getProperty(titleIRI).get().stringValue());
    assertTrue(result.getBaseCommit_resource().isPresent() && result.getBaseCommit_resource().get().equals(COMMIT_IRI));
    assertTrue(result.getAuxiliaryCommit_resource().isPresent() && result.getAuxiliaryCommit_resource().get().equals(COMMIT_IRI));
    assertFalse(result.getModel().contains(IN_PROGRESS_COMMIT_IRI, null, null));
    assertTrue(result.getModel().contains(revisionId, null, null));
}