aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/com/googlesource/gerrit/plugins/qtcodereview/QtCodeReviewIT.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/googlesource/gerrit/plugins/qtcodereview/QtCodeReviewIT.java')
-rw-r--r--src/test/java/com/googlesource/gerrit/plugins/qtcodereview/QtCodeReviewIT.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/java/com/googlesource/gerrit/plugins/qtcodereview/QtCodeReviewIT.java b/src/test/java/com/googlesource/gerrit/plugins/qtcodereview/QtCodeReviewIT.java
index 168f2e1..28a9d73 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/qtcodereview/QtCodeReviewIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/qtcodereview/QtCodeReviewIT.java
@@ -103,6 +103,19 @@ public class QtCodeReviewIT extends LightweightPluginDaemonTest {
return response;
}
+ protected void QtUnStage(PushOneCommit.Result c) throws Exception {
+ RestResponse response = call_REST_API_UnStage(c.getChangeId(), getCurrentPatchId(c));
+ response.assertOK();
+ Change change = c.getChange().change();
+ assertThat(change.getStatus()).isEqualTo(Change.Status.NEW);
+ }
+
+ protected RestResponse call_REST_API_UnStage(String changeId, String revisionId) throws Exception {
+ String url = "/changes/" + changeId + "/revisions/" + revisionId + "/gerrit-plugin-qt-workflow~unstage";
+ RestResponse response = userRestSession.post(url);
+ return response;
+ }
+
protected PushOneCommit.Result pushCommit(String branch,
String message,
String file,
@@ -192,4 +205,8 @@ public class QtCodeReviewIT extends LightweightPluginDaemonTest {
}
}
+ protected String getCurrentPatchId(PushOneCommit.Result c) throws Exception {
+ return String.valueOf(c.getChange().currentPatchSet().getPatchSetId());
+ }
+
}