use of com.google.gerrit.acceptance.testsuite.change.TestHumanComment in project gerrit by GerritCodeReview.
the class CommentsIT method putDraft_humanInReplyTo.
@Test
public void putDraft_humanInReplyTo() throws Exception {
Change.Id changeId = changeOperations.newChange().create();
String parentCommentUuid = changeOperations.change(changeId).currentPatchset().newComment().create();
DraftInput draft = CommentsUtil.newDraft(COMMIT_MSG, Side.REVISION, 0, "foo");
draft.inReplyTo = parentCommentUuid;
String createdDraftUuid = addDraft(changeId, draft).id;
TestHumanComment actual = changeOperations.change(changeId).draftComment(createdDraftUuid).get();
assertThat(actual.parentUuid()).hasValue(parentCommentUuid);
}
use of com.google.gerrit.acceptance.testsuite.change.TestHumanComment in project gerrit by GerritCodeReview.
the class CommentsIT method updatedDraftStillPointsToParentComment.
@Test
public void updatedDraftStillPointsToParentComment() throws Exception {
Account.Id accountId = accountOperations.newAccount().create();
Change.Id changeId = changeOperations.newChange().create();
PatchSet.Id patchsetId = changeOperations.change(changeId).currentPatchset().get().patchsetId();
String parentCommentUuid = changeOperations.change(changeId).patchset(patchsetId).newComment().create();
String draftCommentUuid = changeOperations.change(changeId).patchset(patchsetId).newDraftComment().parentUuid(parentCommentUuid).author(accountId).create();
// Each user can only see their own drafts.
requestScopeOperations.setApiUser(accountId);
DraftInput draftInput = CommentsUtil.newDraft(FILE_NAME, Side.REVISION, 0, "bar");
draftInput.message = "Another comment text.";
gApi.changes().id(changeId.get()).revision(patchsetId.get()).draft(draftCommentUuid).update(draftInput);
TestHumanComment comment = changeOperations.change(changeId).draftComment(draftCommentUuid).get();
assertThat(comment.parentUuid()).hasValue(parentCommentUuid);
}
use of com.google.gerrit.acceptance.testsuite.change.TestHumanComment in project gerrit by GerritCodeReview.
the class CommentsIT method putDraft_robotInReplyTo.
@Test
public void putDraft_robotInReplyTo() throws Exception {
Change.Id changeId = changeOperations.newChange().create();
String parentRobotCommentUuid = changeOperations.change(changeId).currentPatchset().newRobotComment().create();
DraftInput draft = CommentsUtil.newDraft(COMMIT_MSG, Side.REVISION, 0, "foo");
draft.inReplyTo = parentRobotCommentUuid;
String createdDraftUuid = addDraft(changeId, draft).id;
TestHumanComment actual = changeOperations.change(changeId).draftComment(createdDraftUuid).get();
assertThat(actual.parentUuid()).hasValue(parentRobotCommentUuid);
}
Aggregations