use of sonia.scm.web.RestDispatcher in project scm-review-plugin by scm-manager.
the class CommentResourceTest method init.
@Before
public void init() {
when(branchRevisionResolver.getRevisions("space", "name", "1")).thenReturn(new BranchRevisionResolver.RevisionResult("source", "target"));
when(repositoryResolver.resolve(any())).thenReturn(repository);
CommentResource resource = new CommentResource(service, repositoryResolver, new CommentMapperImpl(), new ReplyMapperImpl(), commentPathBuilder, new ExecutedTransitionMapperImpl(), branchRevisionResolver);
when(uriInfo.getAbsolutePathBuilder()).thenReturn(UriBuilder.fromPath("/scm"));
dispatcher = new RestDispatcher();
PullRequestRootResource pullRequestRootResource = new PullRequestRootResource(new PullRequestMapperImpl(), null, serviceFactory, Providers.of(new PullRequestResource(new PullRequestMapperImpl(), null, Providers.of(new CommentRootResource(new CommentMapperImpl(), repositoryResolver, service, Providers.of(resource), commentPathBuilder, pullRequestService, branchRevisionResolver)), null, channelRegistry)));
dispatcher.addSingletonResource(pullRequestRootResource);
when(service.get("space", "name", "1", "1")).thenReturn(EXISTING_ROOT_COMMENT);
}
use of sonia.scm.web.RestDispatcher in project scm-review-plugin by scm-manager.
the class RepositoryConfigResourceTest method init.
@BeforeEach
void init() {
configResource = new RepositoryConfigResource(configService, new RepositoryConfigMapperImpl(), repositoryManager);
dispatcher = new RestDispatcher();
dispatcher.addSingletonResource(configResource);
lenient().when(uriInfo.getBaseUri()).thenReturn(URI.create("localhost/scm/api"));
lenient().when(configService.getRepositoryPullRequestConfig(REPOSITORY)).thenReturn(new PullRequestConfig());
}
use of sonia.scm.web.RestDispatcher in project scm-review-plugin by scm-manager.
the class GlobalConfigResourceTest method init.
@BeforeEach
void init() {
configResource = new GlobalConfigResource(configService, new GlobalConfigMapperImpl());
dispatcher = new RestDispatcher();
dispatcher.addSingletonResource(configResource);
lenient().when(uriInfo.getBaseUri()).thenReturn(URI.create("localhost/scm/api"));
lenient().when(configService.getGlobalPullRequestConfig()).thenReturn(new GlobalPullRequestConfig());
}
use of sonia.scm.web.RestDispatcher in project scm-review-plugin by scm-manager.
the class GlobalEngineConfigResourceTest method init.
@BeforeEach
void init() {
availableRules = new LinkedHashSet<>();
GlobalEngineConfigMapperImpl mapper = new GlobalEngineConfigMapperImpl();
mapper.availableRules = AvailableRules.of(new SuccessRule());
GlobalEngineConfigResource globalEngineConfigResource = new GlobalEngineConfigResource(mapper, configurator, availableRules);
dispatcher = new RestDispatcher();
dispatcher.addSingletonResource(globalEngineConfigResource);
lenient().when(uriInfo.getBaseUri()).thenReturn(URI.create("localhost/scm/api"));
}
Aggregations