Search in sources :

Example 1 with PullRequestRootResource

use of com.cloudogu.scm.review.pullrequest.api.PullRequestRootResource 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"));
}
Also used : PullRequestResource(com.cloudogu.scm.review.pullrequest.api.PullRequestResource) BranchRevisionResolver(com.cloudogu.scm.review.pullrequest.dto.BranchRevisionResolver) PullRequestMapperImpl(com.cloudogu.scm.review.pullrequest.dto.PullRequestMapperImpl) RestDispatcher(sonia.scm.web.RestDispatcher) PullRequestRootResource(com.cloudogu.scm.review.pullrequest.api.PullRequestRootResource) Before(org.junit.Before)

Example 2 with PullRequestRootResource

use of com.cloudogu.scm.review.pullrequest.api.PullRequestRootResource 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);
}
Also used : PullRequestResource(com.cloudogu.scm.review.pullrequest.api.PullRequestResource) BranchRevisionResolver(com.cloudogu.scm.review.pullrequest.dto.BranchRevisionResolver) PullRequestMapperImpl(com.cloudogu.scm.review.pullrequest.dto.PullRequestMapperImpl) RestDispatcher(sonia.scm.web.RestDispatcher) PullRequestRootResource(com.cloudogu.scm.review.pullrequest.api.PullRequestRootResource) Before(org.junit.Before)

Example 3 with PullRequestRootResource

use of com.cloudogu.scm.review.pullrequest.api.PullRequestRootResource in project scm-review-plugin by scm-manager.

the class EngineResultResourceTest method setUpResource.

@BeforeEach
void setUpResource() {
    PullRequestResource pullRequestResource = new PullRequestResource(null, null, null, Providers.of(resource), null);
    PullRequestRootResource pullRequestRootResource = new PullRequestRootResource(null, null, null, Providers.of(pullRequestResource));
    dispatcher.addSingletonResource(pullRequestRootResource);
}
Also used : PullRequestResource(com.cloudogu.scm.review.pullrequest.api.PullRequestResource) PullRequestRootResource(com.cloudogu.scm.review.pullrequest.api.PullRequestRootResource) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

PullRequestResource (com.cloudogu.scm.review.pullrequest.api.PullRequestResource)3 PullRequestRootResource (com.cloudogu.scm.review.pullrequest.api.PullRequestRootResource)3 BranchRevisionResolver (com.cloudogu.scm.review.pullrequest.dto.BranchRevisionResolver)2 PullRequestMapperImpl (com.cloudogu.scm.review.pullrequest.dto.PullRequestMapperImpl)2 Before (org.junit.Before)2 RestDispatcher (sonia.scm.web.RestDispatcher)2 BeforeEach (org.junit.jupiter.api.BeforeEach)1