@Test
public void mergeWithOntologyRecordTest() throws Exception {

    // Setup:
    Model additions = MODEL_FACTORY.createModel();
    Model deletions = MODEL_FACTORY.createModel();
    Resource result = manager.merge(CATALOG_IRI, ontologyRecord.getResource(), sourceBranch.getResource(), targetBranch.getResource(), user, additions, deletions);
    assertEquals(commit.getResource(), result);
    verify(catalogUtils).getRecord(eq(CATALOG_IRI), eq(ontologyRecord.getResource()), eq(ontologyRecordFactory), any(RepositoryConnection.class));
    verify(ontologyService).getSourceBranch(eq(ontologyRecord), eq(sourceBranch.getResource()), any(RepositoryConnection.class));
    verify(ontologyService).getTargetBranch(eq(ontologyRecord), eq(targetBranch.getResource()), any(RepositoryConnection.class));
    verify(ontologyService).getBranchHeadCommit(eq(sourceBranch), any(RepositoryConnection.class));
    verify(ontologyService).getBranchHeadCommit(eq(targetBranch), any(RepositoryConnection.class));
    verify(ontologyService).addCommit(eq(targetBranch), eq(user), eq("Merge of Source into Target"), eq(additions), eq(deletions), eq(commit), eq(commit), any(RepositoryConnection.class));
}