use of sonia.scm.repository.Repository in project scm-review-plugin by scm-manager.
the class RepositoryLinkEnricherTest method shouldNotEnrichRepositoriesForConfigWhenRepositoryConfigIsDisabled.
@Test
@SubjectAware(username = "dent", password = "secret")
public void shouldNotEnrichRepositoriesForConfigWhenRepositoryConfigIsDisabled() {
enricher = new RepositoryLinkEnricher(scmPathInfoStoreProvider, pullRequestService, configService, globalEngineConfigurator);
when(pullRequestService.supportsPullRequests(any())).thenReturn(true);
mockGlobalConfig(true);
Repository repo = new Repository("id", "type", "space", "name");
HalEnricherContext context = HalEnricherContext.of(repo);
enricher.enrich(context, appender);
verify(appender).appendLink("pullRequest", "https://scm-manager.org/scm/api/v2/pull-requests/space/name");
verify(appender, never()).appendLink(eq("pullRequestConfig"), any());
}
use of sonia.scm.repository.Repository in project scm-review-plugin by scm-manager.
the class RepositoryLinkEnricherTest method shouldEnrichPullRequestCheckLink.
@Test
@SubjectAware(username = "dent", password = "secret")
public void shouldEnrichPullRequestCheckLink() {
when(pullRequestService.supportsPullRequests(any())).thenReturn(true);
mockGlobalConfig(true);
enricher = new RepositoryLinkEnricher(scmPathInfoStoreProvider, pullRequestService, configService, globalEngineConfigurator);
Repository repo = new Repository("id", "type", "space", "name");
HalEnricherContext context = HalEnricherContext.of(repo);
enricher.enrich(context, appender);
verify(appender).appendLink("pullRequestCheck", "https://scm-manager.org/scm/api/v2/pull-requests/space/name/check");
}
use of sonia.scm.repository.Repository in project scm-review-plugin by scm-manager.
the class EventListenerTest method createReplyEvent.
private ReplyEvent createReplyEvent() {
Repository repository = RepositoryTestData.createHeartOfGold();
PullRequest pullRequest = TestData.createPullRequest();
mockChannel(repository, pullRequest);
Reply reply = new Reply();
reply.setId("c42");
return new ReplyEvent(repository, pullRequest, reply, reply, null, HandlerEventType.MODIFY);
}
use of sonia.scm.repository.Repository 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 sonia.scm.repository.Repository 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