Search in sources :

Example 11 with CommentEvent

use of com.cloudogu.scm.review.comment.service.CommentEvent in project scm-review-plugin by scm-manager.

the class RemoveReviewMarksOnChangedCommentsHookTest method shouldRemoveMarksOnNewCommentWithSameLocation.

@Test
void shouldRemoveMarksOnNewCommentWithSameLocation() {
    comment.setLocation(new Location("some/file"));
    pullRequest.setReviewMarks(of(new ReviewMark("some/file", "dent")));
    CommentEvent event = new CommentEvent(repository, pullRequest, comment, null, HandlerEventType.CREATE);
    hook.handleCommentEvents(event);
    verify(pullRequestService).removeReviewMarks(repository, pullRequest.getId(), singletonList(new ReviewMark("some/file", "dent")));
}
Also used : CommentEvent(com.cloudogu.scm.review.comment.service.CommentEvent) Location(com.cloudogu.scm.review.comment.service.Location) Test(org.junit.jupiter.api.Test)

Aggregations

CommentEvent (com.cloudogu.scm.review.comment.service.CommentEvent)11 Test (org.junit.jupiter.api.Test)10 Comment (com.cloudogu.scm.review.comment.service.Comment)3 Location (com.cloudogu.scm.review.comment.service.Location)2 PullRequest (com.cloudogu.scm.review.pullrequest.service.PullRequest)1 DynamicTest (org.junit.jupiter.api.DynamicTest)1 Repository (sonia.scm.repository.Repository)1