Search in sources :

Example 1 with InlineContext

use of com.cloudogu.scm.review.comment.service.InlineContext in project scm-review-plugin by scm-manager.

the class CommentRootResourceTest method mockExistingComments.

private void mockExistingComments() {
    Comment comment1 = createComment("1", "1. comment", "author", new Location("file.txt", "123", 0, 3));
    Comment comment2 = createComment("2", "2. comment", "author", new Location("", "", 0, 0));
    comment1.setContext(new InlineContext(ImmutableList.of(copy(new MockedDiffLine.Builder().newLineNumber(1).get()), copy(new MockedDiffLine.Builder().newLineNumber(2).get()), copy(new MockedDiffLine.Builder().newLineNumber(3).get()))));
    Reply reply1 = createReply("2_1", "1. reply", "author");
    Reply reply2 = createReply("2_2", "2. reply", "author");
    comment2.setReplies(asList(reply1, reply2));
    ArrayList<Comment> list = Lists.newArrayList(comment1, comment2);
    when(service.getAll("space", "name", "1")).thenReturn(list);
    when(service.get("space", "name", "1", "1")).thenReturn(comment1);
    when(service.get("space", "name", "1", "2")).thenReturn(comment2);
}
Also used : Comment(com.cloudogu.scm.review.comment.service.Comment) Comment.createComment(com.cloudogu.scm.review.comment.service.Comment.createComment) UriBuilder(javax.ws.rs.core.UriBuilder) Reply(com.cloudogu.scm.review.comment.service.Reply) Reply.createReply(com.cloudogu.scm.review.comment.service.Reply.createReply) InlineContext(com.cloudogu.scm.review.comment.service.InlineContext) Location(com.cloudogu.scm.review.comment.service.Location)

Aggregations

Comment (com.cloudogu.scm.review.comment.service.Comment)1 Comment.createComment (com.cloudogu.scm.review.comment.service.Comment.createComment)1 InlineContext (com.cloudogu.scm.review.comment.service.InlineContext)1 Location (com.cloudogu.scm.review.comment.service.Location)1 Reply (com.cloudogu.scm.review.comment.service.Reply)1 Reply.createReply (com.cloudogu.scm.review.comment.service.Reply.createReply)1 UriBuilder (javax.ws.rs.core.UriBuilder)1