@Test
public void addCommitToMasterOfRecordWithoutIRIWithChangesAndBaseTest() throws Exception {

    try (RepositoryConnection conn = repo.getConnection()) {
        // Setup:
        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);
        Model additionsModel = MODEL_FACTORY.createModel(additions.collect(Collectors.toSet()));
        Model deletions = MODEL_FACTORY.createModel();
        service.addCommit(branch, user, "Message", additionsModel, deletions, commit, null, conn);
        verify(catalogManager).createInProgressCommit(user);
        verify(catalogManager).createCommit(inProgressCommit, "Message", commit, null);
        verify(catalogUtils, times(0)).getCommitChain(any(com.mobi.rdf.api.Resource.class), eq(false), eq(conn));
        verify(catalogUtils, times(0)).getCompiledResource(anyListOf(com.mobi.rdf.api.Resource.class), eq(conn));
        verify(catalogUtils).applyDifference(any(Model.class), any(Difference.class));
        verify(catalogUtils).getObject(any(com.mobi.rdf.api.Resource.class), eq(ontologyRecordFactory), eq(conn));
        verify(ontologyManager).ontologyIriExists(newIRI);
        verify(catalogUtils).updateCommit(commit, additionsModel, deletions, conn);
        verify(catalogUtils).addCommit(branch, commit, conn);
        assertTrue(newRecord.getOntologyIRI().isPresent());
        assertEquals(newIRI, newRecord.getOntologyIRI().get());
        verify(catalogUtils).updateObject(newRecord, conn);
        verify(ontologyCache).clearCacheImports(newIRI);
    }
}