@Test
public void addCommitToOtherBranchWithChangesTest() throws Exception {

    try (RepositoryConnection conn = repo.getConnection()) {
        // Setup:
        Branch newBranch = branchFactory.createNew(VALUE_FACTORY.createIRI("http://mobi.com/test/branches#new"));
        Model additions = MODEL_FACTORY.createModel();
        Model deletions = MODEL_FACTORY.createModel();
        service.addCommit(newBranch, user, "Message", additions, 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, times(0)).applyDifference(any(Model.class), any(Difference.class));
        verify(catalogUtils, times(0)).getObject(record.getResource(), ontologyRecordFactory, conn);
        verify(ontologyManager, times(0)).ontologyIriExists(newIRI);
        verify(catalogUtils).updateCommit(commit, additions, deletions, conn);
        verify(catalogUtils).addCommit(newBranch, commit, conn);
        assertTrue(record.getOntologyIRI().isPresent());
        assertEquals(originalIRI, record.getOntologyIRI().get());
        verify(catalogUtils, times(0)).updateObject(record, conn);
        verify(ontologyCache, times(0)).clearCacheImports(any(com.mobi.rdf.api.Resource.class));
    }
}