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