use of com.google.gerrit.extensions.common.CommentInfo in project gerrit by GerritCodeReview.
the class PatchsetOperationsImplTest method replyToRobotCommentCanBeCreated.
@Test
public void replyToRobotCommentCanBeCreated() throws Exception {
Change.Id changeId = changeOperations.newChange().create();
String parentCommentUuid = changeOperations.change(changeId).currentPatchset().newRobotComment().create();
String commentUuid = changeOperations.change(changeId).currentPatchset().newRobotComment().parentUuid(parentCommentUuid).create();
CommentInfo comment = getRobotCommentFromServerInCurrentPatchset(changeId, commentUuid);
assertThat(comment).inReplyTo().isEqualTo(parentCommentUuid);
}
use of com.google.gerrit.extensions.common.CommentInfo in project gerrit by GerritCodeReview.
the class PatchsetOperationsImplTest method lineCommentCanBeCreated.
@Test
public void lineCommentCanBeCreated() throws Exception {
Change.Id changeId = changeOperations.newChange().file("file1").content("Line 1\nLine 2\nLine 3\nLine 4\n").create();
String commentUuid = changeOperations.change(changeId).currentPatchset().newComment().onLine(3).ofFile("file1").create();
CommentInfo comment = getCommentFromServer(changeId, commentUuid);
assertThat(comment).line().isEqualTo(3);
assertThat(comment).range().isNull();
}
use of com.google.gerrit.extensions.common.CommentInfo in project gerrit by GerritCodeReview.
the class PatchsetOperationsImplTest method draftFileCommentCanBeCreated.
@Test
public void draftFileCommentCanBeCreated() throws Exception {
Change.Id changeId = changeOperations.newChange().file("file1").content("Line 1").create();
String commentUuid = changeOperations.change(changeId).currentPatchset().newDraftComment().onFileLevelOf("file1").create();
CommentInfo comment = getDraftCommentFromServer(changeId, commentUuid);
assertThat(comment).path().isEqualTo("file1");
assertThat(comment).line().isNull();
assertThat(comment).range().isNull();
}
use of com.google.gerrit.extensions.common.CommentInfo in project gerrit by GerritCodeReview.
the class PatchsetOperationsImplTest method commentCanBeCreatedOnSecondParentCommit.
@Test
public void commentCanBeCreatedOnSecondParentCommit() throws Exception {
Change.Id parent1ChangeId = changeOperations.newChange().create();
Change.Id parent2ChangeId = changeOperations.newChange().create();
Change.Id changeId = changeOperations.newChange().mergeOf().change(parent1ChangeId).and().change(parent2ChangeId).create();
String commentUuid = changeOperations.change(changeId).currentPatchset().newComment().onSecondParentCommit().create();
CommentInfo comment = getCommentFromServer(changeId, commentUuid);
assertThat(comment).side().isEqualTo(Side.PARENT);
assertThat(comment).parent().isEqualTo(2);
}
use of com.google.gerrit.extensions.common.CommentInfo in project gerrit by GerritCodeReview.
the class PatchsetOperationsImplTest method commentCanBeCreatedAsResolved.
@Test
public void commentCanBeCreatedAsResolved() throws Exception {
Change.Id changeId = changeOperations.newChange().create();
String commentUuid = changeOperations.change(changeId).currentPatchset().newComment().resolved().create();
CommentInfo comment = getCommentFromServer(changeId, commentUuid);
assertThat(comment).unresolved().isFalse();
}
Aggregations