use of com.cloudogu.scm.review.comment.service.CommentEvent in project scm-review-plugin by scm-manager.
the class MailTextResolverTest method shouldRenderEmailOnModifiedComment.
@Test
void shouldRenderEmailOnModifiedComment() {
CommentEvent event = new CommentEvent(repository, pullRequest, comment, oldComment, HandlerEventType.MODIFY);
CommentEventMailTextResolver renderer = new CommentEventMailTextResolver(event);
assertEmail(renderer, "changed");
}
use of com.cloudogu.scm.review.comment.service.CommentEvent in project scm-review-plugin by scm-manager.
the class MailTextResolverTest method shouldRenderEmailOnCommentTransition.
@Test
void shouldRenderEmailOnCommentTransition() {
Comment taskComment = oldComment.clone();
taskComment.addCommentTransition(new ExecutedTransition<>("new", CommentTransition.MAKE_TASK, System.currentTimeMillis(), "dent"));
CommentEvent event = new CommentEvent(repository, pullRequest, comment, oldComment, HandlerEventType.MODIFY);
CommentEventMailTextResolver renderer = new CommentEventMailTextResolver(event);
assertEmail(renderer, "changed");
}
use of com.cloudogu.scm.review.comment.service.CommentEvent in project scm-review-plugin by scm-manager.
the class RemoveReviewMarksOnChangedCommentsHookTest method shouldIgnoreCommentDeletion.
@Test
void shouldIgnoreCommentDeletion() {
CommentEvent event = new CommentEvent(repository, pullRequest, null, comment, HandlerEventType.DELETE);
hook.handleCommentEvents(event);
verify(pullRequestService, never()).removeReviewMarks(any(), any(), any());
}
use of com.cloudogu.scm.review.comment.service.CommentEvent in project scm-review-plugin by scm-manager.
the class RemoveReviewMarksOnChangedCommentsHookTest method shouldNotRemoveMarksOnNewCommentWithDifferentLocation.
@Test
void shouldNotRemoveMarksOnNewCommentWithDifferentLocation() {
comment.setLocation(new Location("some/other/file"));
pullRequest.setReviewMarks(of(new ReviewMark("some/file", "dent")));
CommentEvent event = new CommentEvent(repository, pullRequest, comment, null, HandlerEventType.CREATE);
hook.handleCommentEvents(event);
verify(pullRequestService, atMost(1)).removeReviewMarks(repository, pullRequest.getId(), emptyList());
}
use of com.cloudogu.scm.review.comment.service.CommentEvent in project scm-review-plugin by scm-manager.
the class RemoveReviewMarksOnChangedCommentsHookTest method shouldIgnoreCommentsWithoutLocation.
@Test
void shouldIgnoreCommentsWithoutLocation() {
CommentEvent event = new CommentEvent(repository, pullRequest, comment, null, HandlerEventType.CREATE);
hook.handleCommentEvents(event);
verify(pullRequestService, never()).removeReviewMarks(any(), any(), any());
}
Aggregations