use of com.cloudogu.scm.review.pullrequest.service.PullRequestEvent in project scm-review-plugin by scm-manager.
the class EventListenerTest method shouldBroadcastMessageForPullRequestEvent.
@Test
void shouldBroadcastMessageForPullRequestEvent() {
bindSessionId("1-2-3");
PullRequestEvent event = createPullRequestEvent();
listener.handle(event);
verify(channel).broadcast(captor.capture());
assertMessageHasCorrectTypeAndName(PullRequestEvent.class);
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequestEvent in project scm-review-plugin by scm-manager.
the class EventListenerTest method createPullRequestEvent.
private PullRequestEvent createPullRequestEvent() {
Repository repository = RepositoryTestData.createHeartOfGold();
PullRequest pullRequest = TestData.createPullRequest();
mockChannel(repository, pullRequest);
return new PullRequestEvent(repository, pullRequest, null, HandlerEventType.CREATE);
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequestEvent in project scm-review-plugin by scm-manager.
the class MailTextResolverTest method shouldNotRenderReviewerEmailOnCreatedPullRequest.
@Test
void shouldNotRenderReviewerEmailOnCreatedPullRequest() {
PullRequestEvent event = new PullRequestEvent(repository, pullRequest, oldPullRequest, HandlerEventType.CREATE);
PullRequestEventMailTextResolver renderer = new PullRequestEventMailTextResolver(event, false);
assertEmail(renderer, "created").doesNotContain("You are chosen as reviewer for this pull request.");
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequestEvent in project scm-review-plugin by scm-manager.
the class MailTextResolverTest method shouldRenderEmailOnModifiedPullRequest.
@Test
void shouldRenderEmailOnModifiedPullRequest() {
PullRequestEvent event = new PullRequestEvent(repository, pullRequest, oldPullRequest, HandlerEventType.MODIFY);
PullRequestEventMailTextResolver renderer = new PullRequestEventMailTextResolver(event, false);
assertEmail(renderer, "changed");
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequestEvent in project scm-review-plugin by scm-manager.
the class EventListenerTest method shouldSendSessionIdWithMessage.
@Test
void shouldSendSessionIdWithMessage() {
SessionId sessionId = bindSessionId("1-2-3");
PullRequestEvent event = createPullRequestEvent();
listener.handle(event);
verify(channel).broadcast(captor.capture());
assertMessageHasCorrectTypeAndName(PullRequestEvent.class);
assertThat(captor.getValue().getSender()).contains(sessionId);
}
Aggregations