use of sonia.scm.repository.PostReceiveRepositoryHookEvent in project scm-review-plugin by scm-manager.
the class ProcessChangedFilesHookTest method createRepositoryHookEvent.
private PostReceiveRepositoryHookEvent createRepositoryHookEvent(List<String> branches) {
PostReceiveRepositoryHookEvent event = mock(PostReceiveRepositoryHookEvent.class, Answers.RETURNS_DEEP_STUBS);
when(event.getRepository()).thenReturn(repository);
when(event.getContext().getBranchProvider().getCreatedOrModified()).thenReturn(branches);
return event;
}
use of sonia.scm.repository.PostReceiveRepositoryHookEvent in project scm-review-plugin by scm-manager.
the class ProcessChangedFilesHookTest method prepareEvent.
private PostReceiveRepositoryHookEvent prepareEvent(Comment... comments) {
lenient().when(commentCollector.collectNonOutdated(repository, pullRequest)).thenReturn(Stream.of(comments));
List<String> branches = ImmutableList.of(pullRequest.getSource(), pullRequest.getTarget());
PostReceiveRepositoryHookEvent event = createRepositoryHookEvent(branches);
lenient().when(pullRequestCollector.collectAffectedPullRequests(repository, branches)).thenReturn(ImmutableList.of(pullRequest));
List<Changeset> changesets = ImmutableList.of(new Changeset(), new Changeset());
lenient().when(event.getContext().getChangesetProvider().getChangesets()).thenReturn(changesets);
return event;
}
use of sonia.scm.repository.PostReceiveRepositoryHookEvent in project scm-review-plugin by scm-manager.
the class ProcessChangedFilesHookTest method flagAffectedComments.
private void flagAffectedComments(Comment... comments) {
PostReceiveRepositoryHookEvent event = prepareEvent(comments);
hook.checkChangedFiles(event);
}
Aggregations