@Test
public void acceptMergeRequestTest() {

    try (RepositoryConnection conn = repo.getConnection()) {
        manager.acceptMergeRequest(request1.getResource(), user1, conn);
    }
    verify(utilsService).getConflicts(eq(sourceCommit1.getResource()), eq(targetCommit1.getResource()), any(RepositoryConnection.class));
    verify(versioningManager).merge(LOCAL_CATALOG_IRI, RECORD_1_IRI, SOURCE_BRANCH_1_IRI, TARGET_BRANCH_1_IRI, user1, null, null);
    verify(utilsService).updateObject(argThat(matches((AcceptedMergeRequest r) -> {
        boolean hasResource = r.getResource().equals(request1.getResource());
        boolean hasNoSourceBranch = !r.getSourceBranch_resource().isPresent();
        boolean hasNoTargetBranch = !r.getTargetBranch_resource().isPresent();
        boolean hasNoRemoveSource = !r.getRemoveSource().isPresent();
        boolean hasSourceTitle = r.getSourceBranchTitle().isPresent() && r.getSourceBranchTitle().get().equals(SOURCE_BRANCH_TITLE);
        boolean hasTargetTitle = r.getTargetBranchTitle().isPresent() && r.getTargetBranchTitle().get().equals(TARGET_BRANCH_TITLE);
        boolean hasSourceCommit = r.getSourceCommit_resource().isPresent() && r.getSourceCommit_resource().get().equals(sourceCommit1.getResource());
        boolean hasTargetCommit = r.getTargetCommit_resource().isPresent() && r.getTargetCommit_resource().get().equals(targetCommit1.getResource());
        return hasResource && hasNoSourceBranch && hasNoTargetBranch && hasNoRemoveSource && hasSourceTitle && hasTargetTitle && hasSourceCommit && hasTargetCommit ;
    })), any(RepositoryConnection.class));
}