use of com.cloudogu.scm.review.pullrequest.service.PullRequestUpdatedEvent in project scm-review-plugin by scm-manager.
the class EventListenerTest method shouldBroadcastPullRequestUpdatedEvent.
@Test
void shouldBroadcastPullRequestUpdatedEvent() {
bindSessionId("1-2-3");
PullRequestUpdatedEvent event = createPullRequestUpdatedEvent();
listener.handle(event);
verify(channel).broadcast(captor.capture());
assertMessageHasCorrectTypeAndName(PullRequestUpdatedEvent.class);
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequestUpdatedEvent in project scm-review-plugin by scm-manager.
the class EmailNotificationHookTest method shouldSendEmailsAfterUpdatingPullRequest.
@Test
void shouldSendEmailsAfterUpdatingPullRequest() throws Exception {
PullRequestUpdatedEvent event = new PullRequestUpdatedEvent(repository, pullRequest);
emailNotificationHook.handleUpdatedPullRequest(event);
ArgumentCaptor<PullRequestUpdatedMailTextResolver> captor = ArgumentCaptor.forClass(PullRequestUpdatedMailTextResolver.class);
verify(service).sendEmail(eq(of(subscribedButNotReviewer, subscribedAndReviewer)), captor.capture());
PullRequestUpdatedMailTextResolver resolver = captor.getValue();
assertThat(resolver.getMailSubject(Locale.ENGLISH)).contains("PR updated");
assertThat(resolver.getTopic()).isEqualTo(TOPIC_PR_UPDATED);
assertThat(resolver.getContentTemplatePath()).contains("updated_pull_request");
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequestUpdatedEvent in project scm-review-plugin by scm-manager.
the class EventListenerTest method createPullRequestUpdatedEvent.
private PullRequestUpdatedEvent createPullRequestUpdatedEvent() {
Repository repository = RepositoryTestData.createHeartOfGold();
PullRequest pullRequest = TestData.createPullRequest();
mockChannel(repository, pullRequest);
return new PullRequestUpdatedEvent(repository, pullRequest);
}
Aggregations