use of com.google.gerrit.entities.HumanComment in project gerrit by GerritCodeReview.
the class CommentThreadTest method threadCanBeUnresolved.
@Test
public void threadCanBeUnresolved() {
HumanComment root = unresolved(createComment("root"));
CommentThread<Comment> commentThread = CommentThread.builder().addComment(root).build();
assertThat(commentThread.unresolved()).isTrue();
}
use of com.google.gerrit.entities.HumanComment in project gerrit by GerritCodeReview.
the class CommentThreadTest method threadCanBeResolved.
@Test
public void threadCanBeResolved() {
HumanComment root = resolved(createComment("root"));
CommentThread<Comment> commentThread = CommentThread.builder().addComment(root).build();
assertThat(commentThread.unresolved()).isFalse();
}
use of com.google.gerrit.entities.HumanComment in project gerrit by GerritCodeReview.
the class CommentThreadTest method lastCommentInThreadDeterminesUnresolvedStatus.
@Test
public void lastCommentInThreadDeterminesUnresolvedStatus() {
HumanComment root = resolved(createComment("root"));
HumanComment child = unresolved(createComment("child"));
CommentThread<Comment> commentThread = CommentThread.builder().addComment(root).addComment(child).build();
assertThat(commentThread.unresolved()).isTrue();
}
use of com.google.gerrit.entities.HumanComment in project gerrit by GerritCodeReview.
the class CommentThreadsTest method threadsConsiderParentRelationshipStrongerThanDate.
@Test
public void threadsConsiderParentRelationshipStrongerThanDate() {
HumanComment root = writtenOn(createComment("root"), Instant.ofEpochMilli(3));
HumanComment child1 = writtenOn(asReply(createComment("child1"), "root"), Instant.ofEpochMilli(2));
HumanComment child2 = writtenOn(asReply(createComment("child2"), "child1"), Instant.ofEpochMilli(1));
ImmutableList<HumanComment> comments = ImmutableList.of(child2, child1, root);
ImmutableSet<CommentThread<HumanComment>> commentThreads = CommentThreads.forComments(comments).getThreads();
ImmutableSet<CommentThread<HumanComment>> expectedThreads = ImmutableSet.of(toThread(root, child1, child2));
assertThat(commentThreads).isEqualTo(expectedThreads);
}
use of com.google.gerrit.entities.HumanComment in project gerrit by GerritCodeReview.
the class CommentThreadsTest method threadsFallBackToUuidOrderIfParentAndDateAreTheSame.
@Test
public void threadsFallBackToUuidOrderIfParentAndDateAreTheSame() {
HumanComment root = writtenOn(createComment("root"), Instant.ofEpochMilli(1));
HumanComment sibling1 = writtenOn(asReply(createComment("sibling1"), "root"), Instant.ofEpochMilli(2));
HumanComment sibling2 = writtenOn(asReply(createComment("sibling2"), "root"), Instant.ofEpochMilli(2));
ImmutableList<HumanComment> comments = ImmutableList.of(sibling2, sibling1, root);
ImmutableSet<CommentThread<HumanComment>> commentThreads = CommentThreads.forComments(comments).getThreads();
ImmutableSet<CommentThread<HumanComment>> expectedThreads = ImmutableSet.of(toThread(root, sibling1, sibling2));
assertThat(commentThreads).isEqualTo(expectedThreads);
}
Aggregations