use of com.cloudogu.scm.review.comment.service.ReplyEvent in project scm-review-plugin by scm-manager.
the class EmailNotificationHookTest method sendingReplyEmailTestFactory.
@TestFactory
Stream<DynamicTest> sendingReplyEmailTestFactory() {
Reply reply = Reply.createReply("1", "42", currentUser);
Reply oldReply = Reply.createReply("1", "have to think", currentUser);
comment.setAuthor("first author");
comment.setReplies(asList(reply, Reply.createReply("0", "dumb question", "former participant")));
ArrayList<ReplyEvent> events = Lists.newArrayList(new ReplyEvent(repository, pullRequest, reply, null, comment, HandlerEventType.CREATE), new ReplyEvent(repository, pullRequest, reply, oldReply, comment, HandlerEventType.MODIFY), new ReplyEvent(repository, pullRequest, null, oldReply, comment, HandlerEventType.DELETE));
return events.stream().map(event -> DynamicTest.dynamicTest(event.getEventType().toString(), () -> {
emailNotificationHook.handleReplyEvents(event);
verify(service).sendEmail(eq(of(subscribedButNotReviewer, subscribedAndReviewer)), isA(CommentEventMailTextResolver.class));
verify(service).sendEmail(eq(of("first author", "former participant")), isA(ReplyEventMailTextResolver.class));
reset(service);
}));
}
Aggregations