use of com.cloudogu.scm.review.comment.service.CommentEvent in project scm-review-plugin by scm-manager.
the class EventListenerTest method createCommentEvent.
private CommentEvent createCommentEvent() {
Repository repository = RepositoryTestData.createHeartOfGold();
PullRequest pullRequest = TestData.createPullRequest();
mockChannel(repository, pullRequest);
Comment comment = new Comment();
comment.setId("c42");
return new CommentEvent(repository, pullRequest, null, comment, HandlerEventType.DELETE);
}
use of com.cloudogu.scm.review.comment.service.CommentEvent in project scm-review-plugin by scm-manager.
the class EmailNotificationHookTest method shouldNotSendSystemEmails.
@Test
void shouldNotSendSystemEmails() throws Exception {
Comment systemComment = Comment.createSystemComment("1");
CommentEvent commentEvent = new CommentEvent(repository, pullRequest, systemComment, oldComment, HandlerEventType.CREATE);
emailNotificationHook.handleCommentEvents(commentEvent);
verify(service, never()).sendEmail(any(), any());
verify(service, never()).sendEmail(any(), any());
reset(service);
}
use of com.cloudogu.scm.review.comment.service.CommentEvent in project scm-review-plugin by scm-manager.
the class MailTextResolverTest method shouldRenderEmailOnDeletedComment.
@Test
void shouldRenderEmailOnDeletedComment() {
CommentEvent event = new CommentEvent(repository, pullRequest, comment, oldComment, HandlerEventType.DELETE);
CommentEventMailTextResolver renderer = new CommentEventMailTextResolver(event);
assertEmail(renderer, "deleted");
}
use of com.cloudogu.scm.review.comment.service.CommentEvent in project scm-review-plugin by scm-manager.
the class MailTextResolverTest method shouldRenderEmailOnCreatedComment.
@Test
void shouldRenderEmailOnCreatedComment() {
CommentEvent event = new CommentEvent(repository, pullRequest, comment, oldComment, HandlerEventType.CREATE);
CommentEventMailTextResolver renderer = new CommentEventMailTextResolver(event);
assertEmail(renderer, "added");
}
use of com.cloudogu.scm.review.comment.service.CommentEvent in project scm-review-plugin by scm-manager.
the class EventListenerTest method shouldBroadcastMessageForCommentEvent.
@Test
void shouldBroadcastMessageForCommentEvent() {
bindSessionId("4-2");
CommentEvent event = createCommentEvent();
listener.handle(event);
verify(channel).broadcast(captor.capture());
assertMessageHasCorrectTypeAndName(CommentEvent.class);
}
Aggregations