SimpleMergeRequestManager implements MergeRequestManager { @Override public void deleteMergeRequestsWithRecordId(Resource recordId) { try (RepositoryConnection conn = configProvider.getRepository().getConnection()) { deleteMergeRequestsWithRecordId(recordId, conn); } }  @Override List<MergeRequest> getMergeRequests(MergeRequestFilterParams params); @Override List<MergeRequest> getMergeRequests(MergeRequestFilterParams params, RepositoryConnection conn); @Override MergeRequest createMergeRequest(MergeRequestConfig config, Resource localCatalog); @Override MergeRequest createMergeRequest(MergeRequestConfig config, Resource localCatalog,
                                           RepositoryConnection conn); @Override void addMergeRequest(MergeRequest request); @Override void addMergeRequest(MergeRequest request, RepositoryConnection conn); @Override Optional<MergeRequest> getMergeRequest(Resource requestId); @Override Optional<MergeRequest> getMergeRequest(Resource requestId, RepositoryConnection conn); @Override void updateMergeRequest(Resource requestId, MergeRequest request); @Override void updateMergeRequest(Resource requestId, MergeRequest request, RepositoryConnection conn); @Override void deleteMergeRequest(Resource requestId); @Override void deleteMergeRequest(Resource requestId, RepositoryConnection conn); @Override void acceptMergeRequest(Resource requestId, User user); @Override void acceptMergeRequest(Resource requestId, User user,  RepositoryConnection conn); @Override void deleteMergeRequestsWithRecordId(Resource recordId); @Override void deleteMergeRequestsWithRecordId(Resource recordId, RepositoryConnection conn); @Override void cleanMergeRequests(Resource recordId, Resource branchId); @Override void cleanMergeRequests(Resource recordId, Resource branchId, RepositoryConnection conn); @Override Comment createComment(Resource requestId, User user, String commentStr); @Override Comment createComment(Resource requestId, User user, String commentStr, Resource parentCommentId); @Override List<List<Comment>> getComments(Resource requestId); @Override Optional<Comment> getComment(Resource commentId); @Override Optional<Comment> getComment(Resource commentId, RepositoryConnection conn); @Override void updateComment(Resource commentId, Comment comment); @Override void deleteComment(Resource commentId); @Override void deleteCommentsWithRequestId(Resource requestId);  }
@Test public void deleteMergeRequestsWithRecordId() { try (RepositoryConnection conn = repo.getConnection()) { manager.deleteMergeRequestsWithRecordId(RECORD_1_IRI, conn); } verify(utilsService, times(13)).validateResource(any(Resource.class), eq(commentFactory.getTypeIRI()), any(RepositoryConnection.class)); verify(utilsService).remove(eq(comment1.getResource()), any(RepositoryConnection.class)); verify(utilsService).remove(eq(comment2.getResource()), any(RepositoryConnection.class)); verify(utilsService).remove(eq(comment3.getResource()), any(RepositoryConnection.class)); verify(utilsService).remove(eq(comment4.getResource()), any(RepositoryConnection.class)); verify(utilsService).remove(eq(commentA.getResource()), any(RepositoryConnection.class)); verify(utilsService).remove(eq(commentB.getResource()), any(RepositoryConnection.class)); verify(utilsService).remove(eq(commentC.getResource()), any(RepositoryConnection.class)); verify(utilsService).remove(eq(request1.getResource()), any(RepositoryConnection.class)); verify(utilsService).remove(eq(request4.getResource()), any(RepositoryConnection.class)); verify(utilsService, never()).remove(eq(request2.getResource()), any(RepositoryConnection.class)); verify(utilsService, never()).remove(eq(request3.getResource()), any(RepositoryConnection.class)); }
@Test public void deleteMergeRequestsWithRecordIdRecordWithNoMR() { try (RepositoryConnection conn = repo.getConnection()) { manager.deleteMergeRequestsWithRecordId(VALUE_FACTORY.createIRI("http: } verify(utilsService, never()).remove(any(Resource.class), any(RepositoryConnection.class)); }