use of com.google.gerrit.extensions.common.CommentInfo in project gerrit by GerritCodeReview.
the class PatchsetOperationsImplTest method draftCommentCanBeCreatedOnSecondParentCommit.
@Test
public void draftCommentCanBeCreatedOnSecondParentCommit() 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().newDraftComment().onSecondParentCommit().create();
CommentInfo comment = getDraftCommentFromServer(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 robotCommentIsCreatedWithSpecifiedMessage.
@Test
public void robotCommentIsCreatedWithSpecifiedMessage() throws Exception {
Change.Id changeId = changeOperations.newChange().create();
String commentUuid = changeOperations.change(changeId).currentPatchset().newRobotComment().message("Test comment message").create();
CommentInfo comment = getRobotCommentFromServerInCurrentPatchset(changeId, commentUuid);
assertThat(comment).message().isEqualTo("Test comment message");
}
use of com.google.gerrit.extensions.common.CommentInfo in project gerrit by GerritCodeReview.
the class PatchsetOperationsImplTest method tagCanBeAttachedToAComment.
@Test
public void tagCanBeAttachedToAComment() throws Exception {
Change.Id changeId = changeOperations.newChange().create();
String commentUuid = changeOperations.change(changeId).currentPatchset().newComment().tag("my special tag").create();
CommentInfo comment = getCommentFromServer(changeId, commentUuid);
assertThat(comment).tag().isEqualTo("my special tag");
}
use of com.google.gerrit.extensions.common.CommentInfo in project gerrit by GerritCodeReview.
the class PatchsetOperationsImplTest method robotCommentCanBeCreatedOnPatchsetCommit.
@Test
public void robotCommentCanBeCreatedOnPatchsetCommit() throws Exception {
Change.Id changeId = changeOperations.newChange().create();
String commentUuid = changeOperations.change(changeId).currentPatchset().newRobotComment().onPatchsetCommit().create();
CommentInfo comment = getRobotCommentFromServerInCurrentPatchset(changeId, commentUuid);
// Null is often used instead of Side.REVISION as Side.REVISION is the default.
assertThat(comment).side().isAnyOf(Side.REVISION, null);
assertThat(comment).parent().isNull();
}
use of com.google.gerrit.extensions.common.CommentInfo in project gerrit by GerritCodeReview.
the class PatchsetOperationsImplTest method commentCanBeCreatedOnPatchsetCommit.
@Test
public void commentCanBeCreatedOnPatchsetCommit() throws Exception {
Change.Id changeId = changeOperations.newChange().create();
String commentUuid = changeOperations.change(changeId).currentPatchset().newComment().onPatchsetCommit().create();
CommentInfo comment = getCommentFromServer(changeId, commentUuid);
// Null is often used instead of Side.REVISION as Side.REVISION is the default.
assertThat(comment).side().isAnyOf(Side.REVISION, null);
assertThat(comment).parent().isNull();
}
Aggregations