Set '_more_groups' on last group of query result

If the number of groups matching the query exceeds the limit the
last group has a '_more_groups: true' JSON field set.

Change-Id: I6f1fcda58813e2c7b5dc788d88b989c377afec7e
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2017-01-03 15:16:17 +01:00
parent fffc6ddc37
commit fadf363ef0
4 changed files with 21 additions and 5 deletions

View File

@@ -193,8 +193,10 @@ public abstract class AbstractQueryGroupsTest extends GerritServerTests {
String query =
"uuid:" + group1.id + " OR uuid:" + group2.id + " OR uuid:" + group3.id;
List<GroupInfo> result = assertQuery(query, group1, group2, group3);
assertThat(result.get(result.size() - 1)._moreGroups).isNull();
assertQuery(newQuery(query).withLimit(2), result.subList(0, 2));
result = assertQuery(newQuery(query).withLimit(2), result.subList(0, 2));
assertThat(result.get(result.size() - 1)._moreGroups).isTrue();
}
@Test