@Test
public void addCommitToMasterWithCommitWithBaseAndNewOntologyIRITest() throws Exception {

    try (RepositoryConnection conn = repo.getConnection()) {
        // Setup:
        commit.setBaseCommit(commitFactory.createNew(VALUE_FACTORY.createIRI("http://mobi.com/test/commits#new")));
        service.addCommit(branch, commit, conn);
        verify(catalogUtils).addCommit(branch, commit, conn);
        verify(catalogUtils).getAdditions(commit, conn);
        verify(catalogUtils).getObject(record.getResource(), ontologyRecordFactory, conn);
        verify(ontologyManager).ontologyIriExists(newIRI);
        assertTrue(record.getOntologyIRI().isPresent());
        assertEquals(newIRI, record.getOntologyIRI().get());
        verify(catalogUtils).updateObject(record, conn);
        verify(ontologyCache).clearCacheImports(originalIRI);
        verify(ontologyCache).clearCacheImports(newIRI);
    }
}