Search in sources :

Example 1 with PullRequestMapperImpl

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"));
}
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 PullRequestMapperImpl

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);
}
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)

Aggregations

PullRequestResource (com.cloudogu.scm.review.pullrequest.api.PullRequestResource)2 PullRequestRootResource (com.cloudogu.scm.review.pullrequest.api.PullRequestRootResource)2 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