@Test
public void addCommitToMasterOfRecordWithoutIRIWithCommitWithBaseTest() throws Exception {

    try (RepositoryConnection conn = repo.getConnection()) {
        // Setup:
        commit.setBaseCommit(commitFactory.createNew(VALUE_FACTORY.createIRI("http://mobi.com/test/commits#new")));
        OntologyRecord newRecord = ontologyRecordFactory.createNew(VALUE_FACTORY.createIRI("http://mobi.com/test/records#new"));
        when(catalogUtils.getObject(any(com.mobi.rdf.api.Resource.class), eq(ontologyRecordFactory), eq(conn))).thenReturn(newRecord);
        service.addCommit(branch, commit, conn);
        verify(catalogUtils).addCommit(branch, commit, conn);
        verify(catalogUtils).getAdditions(commit, conn);
        verify(catalogUtils).getObject(any(com.mobi.rdf.api.Resource.class), eq(ontologyRecordFactory), eq(conn));
        verify(ontologyManager).ontologyIriExists(newIRI);
        assertTrue(newRecord.getOntologyIRI().isPresent());
        assertEquals(newIRI, newRecord.getOntologyIRI().get());
        verify(catalogUtils).updateObject(newRecord, conn);
        verify(ontologyCache).clearCacheImports(newIRI);
    }
}