summaryrefslogtreecommitdiffstats
path: root/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/QueryIT.java
diff options
context:
space:
mode:
Diffstat (limited to 'gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/QueryIT.java')
-rw-r--r--gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/QueryIT.java30
1 files changed, 11 insertions, 19 deletions
diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/QueryIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/QueryIT.java
index 591c6d698e..50b2a78d77 100644
--- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/QueryIT.java
+++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/QueryIT.java
@@ -15,7 +15,6 @@
package com.google.gerrit.acceptance.ssh;
import static com.google.common.truth.Truth.assertThat;
-import static com.google.gerrit.acceptance.GitUtil.initSsh;
import com.google.common.collect.Lists;
import com.google.gerrit.acceptance.AbstractDaemonTest;
@@ -25,6 +24,7 @@ import com.google.gerrit.acceptance.SshSession;
import com.google.gerrit.acceptance.UseSsh;
import com.google.gerrit.extensions.api.changes.AddReviewerInput;
import com.google.gerrit.extensions.api.changes.ReviewInput;
+import com.google.gerrit.extensions.client.ListChangesOption;
import com.google.gerrit.extensions.client.Side;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gson.Gson;
@@ -288,24 +288,16 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
- public void queryWithNonVisibleCurrentPatchSet() throws Exception {
- String changeId = createChange().getChangeId();
- amendChangeAsDraft(changeId);
- String query = "--current-patch-set --patch-sets " + changeId;
- List<ChangeAttribute> changes = executeSuccessfulQuery(query);
- assertThat(changes).hasSize(1);
- assertThat(changes.get(0).patchSets).isNotNull();
- assertThat(changes.get(0).patchSets).hasSize(2);
- assertThat(changes.get(0).currentPatchSet).isNotNull();
-
- SshSession userSession = new SshSession(server, user);
- initSsh(user);
- userSession.open();
- changes = executeSuccessfulQuery(query, userSession);
- assertThat(changes).hasSize(1);
- assertThat(changes.get(0).patchSets).hasSize(1);
- assertThat(changes.get(0).currentPatchSet).isNull();
- userSession.close();
+ public void allChangeOptionsAreServedWithoutExceptions() throws Exception {
+ PushOneCommit.Result r = createChange();
+ // Merge the change so that the result has more data and potentially went through more
+ // computation while formatting the output, such as labels, reviewers etc.
+ merge(r);
+ for (ListChangesOption option : ListChangesOption.values()) {
+ assertThat(gApi.changes().query(r.getChangeId()).withOption(option).get())
+ .named("Option: " + option)
+ .hasSize(1);
+ }
}
private List<ChangeAttribute> executeSuccessfulQuery(String params, SshSession session)