use of com.cloudogu.scm.review.pullrequest.dto.PullRequestMapperImpl in project scm-review-plugin by scm-manager.
the class CommentRootResourceTest method init.
@Before
public void init() {
when(repositoryResolver.resolve(any())).thenReturn(repository);
commentMapper.setReplyMapper(replyMapper);
commentMapper.setExecutedTransitionMapper(executedTransitionMapper);
commentMapper.setPossibleTransitionMapper(possibleTransitionMapper);
replyMapper.setExecutedTransitionMapper(executedTransitionMapper);
CommentRootResource resource = new CommentRootResource(commentMapper, repositoryResolver, service, commentResourceProvider, commentPathBuilder, pullRequestService, 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(resource), null, channelRegistry)));
dispatcher.addSingletonResource(pullRequestRootResource);
when(branchRevisionResolver.getRevisions(any(), any(), any())).thenReturn(new BranchRevisionResolver.RevisionResult("source", "target"));
when(branchRevisionResolver.getRevisions(any(), any())).thenReturn(new BranchRevisionResolver.RevisionResult("source", "target"));
}
use of com.cloudogu.scm.review.pullrequest.dto.PullRequestMapperImpl 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);
}
Aggregations