Search in sources :

Example 1 with RestCall

use of com.google.gerrit.acceptance.rest.util.RestCall in project gerrit by GerritCodeReview.

the class ChangesRestApiBindingsIT method commentEndpoints.

@Test
public void commentEndpoints() throws Exception {
    String changeId = createChange().getChangeId();
    for (RestCall restCall : COMMENT_ENDPOINTS) {
        DraftInput draftInput = new DraftInput();
        draftInput.path = Patch.COMMIT_MSG;
        draftInput.side = Side.REVISION;
        draftInput.line = 1;
        draftInput.message = "draft comment";
        CommentInfo commentInfo = gApi.changes().id(changeId).current().createDraft(draftInput).get();
        ReviewInput reviewInput = new ReviewInput();
        reviewInput.drafts = DraftHandling.PUBLISH;
        gApi.changes().id(changeId).current().review(reviewInput);
        RestApiCallHelper.execute(adminRestSession, restCall, changeId, "current", commentInfo.id);
    }
}
Also used : RestCall(com.google.gerrit.acceptance.rest.util.RestCall) DraftInput(com.google.gerrit.extensions.api.changes.DraftInput) CommentInfo(com.google.gerrit.extensions.common.CommentInfo) RobotCommentInfo(com.google.gerrit.extensions.common.RobotCommentInfo) ReviewInput(com.google.gerrit.extensions.api.changes.ReviewInput) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 2 with RestCall

use of com.google.gerrit.acceptance.rest.util.RestCall in project gerrit by GerritCodeReview.

the class ChangesRestApiBindingsIT method draftCommentEndpoints.

@Test
public void draftCommentEndpoints() throws Exception {
    String changeId = createChange().getChangeId();
    for (RestCall restCall : DRAFT_COMMENT_ENDPOINTS) {
        DraftInput draftInput = new DraftInput();
        draftInput.path = Patch.COMMIT_MSG;
        draftInput.side = Side.REVISION;
        draftInput.line = 1;
        draftInput.message = "draft comment";
        CommentInfo draftInfo = gApi.changes().id(changeId).current().createDraft(draftInput).get();
        RestApiCallHelper.execute(adminRestSession, restCall, changeId, "current", draftInfo.id);
    }
}
Also used : RestCall(com.google.gerrit.acceptance.rest.util.RestCall) DraftInput(com.google.gerrit.extensions.api.changes.DraftInput) CommentInfo(com.google.gerrit.extensions.common.CommentInfo) RobotCommentInfo(com.google.gerrit.extensions.common.RobotCommentInfo) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Aggregations

AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)2 RestCall (com.google.gerrit.acceptance.rest.util.RestCall)2 DraftInput (com.google.gerrit.extensions.api.changes.DraftInput)2 CommentInfo (com.google.gerrit.extensions.common.CommentInfo)2 RobotCommentInfo (com.google.gerrit.extensions.common.RobotCommentInfo)2 Test (org.junit.Test)2 ReviewInput (com.google.gerrit.extensions.api.changes.ReviewInput)1