use of com.cloudogu.scm.review.pullrequest.service.PullRequestMergedEvent in project scm-review-plugin by scm-manager.
the class CommentServiceTest method shouldAddCommentOnMergeEvent.
@Test
@SubjectAware(username = "dent")
public void shouldAddCommentOnMergeEvent() {
when(store.add(eq(PULL_REQUEST_ID), rootCommentCaptor.capture())).thenReturn("newId");
commentService.addCommentOnMerge(new PullRequestMergedEvent(REPOSITORY, mockPullRequest()));
assertThat(rootCommentCaptor.getAllValues()).hasSize(1);
Comment storedComment = rootCommentCaptor.getValue();
assertThat(storedComment.getComment()).isEqualTo("merged");
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequestMergedEvent in project scm-review-plugin by scm-manager.
the class EventListenerTest method createPullRequestMergedEvent.
private PullRequestMergedEvent createPullRequestMergedEvent() {
Repository repository = RepositoryTestData.createHeartOfGold();
PullRequest pullRequest = TestData.createPullRequest();
mockChannel(repository, pullRequest);
return new PullRequestMergedEvent(repository, pullRequest);
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequestMergedEvent in project scm-review-plugin by scm-manager.
the class EventListenerTest method shouldBroadcastPullRequestMergedEvent.
@Test
void shouldBroadcastPullRequestMergedEvent() {
bindSessionId("1-2-3");
PullRequestMergedEvent event = createPullRequestMergedEvent();
listener.handle(event);
verify(channel).broadcast(captor.capture());
assertMessageHasCorrectTypeAndName(PullRequestMergedEvent.class);
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequestMergedEvent in project scm-review-plugin by scm-manager.
the class EmailNotificationHookTest method shouldSendEmailsAfterMergingPullRequest.
@Test
void shouldSendEmailsAfterMergingPullRequest() throws Exception {
PullRequestMergedEvent event = new PullRequestMergedEvent(repository, pullRequest);
emailNotificationHook.handleMergedPullRequest(event);
verify(service).sendEmail(eq(of(subscribedButNotReviewer, subscribedAndReviewer)), isA(PullRequestMergedMailTextResolver.class));
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequestMergedEvent in project scm-review-plugin by scm-manager.
the class MailTextResolverTest method shouldRenderEmailOnMergedPullRequest.
@Test
void shouldRenderEmailOnMergedPullRequest() {
PullRequestMergedEvent event = new PullRequestMergedEvent(repository, pullRequest);
PullRequestMergedMailTextResolver renderer = new PullRequestMergedMailTextResolver(event);
assertEmail(renderer, "merged");
}
Aggregations