Set '_more_accounts' on last account of query result

If the number of accounts matching the query exceeds the limit the
last account has a '_more_accounts: true' JSON field set.

Change-Id: Icc8c34c37c72f7df00bb06c67602bea36a4ae09f
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2016-06-30 15:29:05 +02:00
parent 6115eae5d0
commit 7bb93e4601
4 changed files with 45 additions and 31 deletions

View File

@@ -252,8 +252,11 @@ public abstract class AbstractQueryAccountsTest extends GerritServerTests {
AccountInfo user2 = newAccountWithEmail("user2", "user2@" + domain);
AccountInfo user3 = newAccountWithEmail("user3", "user3@" + domain);
assertQuery(domain, user1, user2, user3);
assertQuery(newQuery(domain).withLimit(2), user1, user2);
List<AccountInfo> result = assertQuery(domain, user1, user2, user3);
assertThat(result.get(result.size() - 1)._moreAccounts).isNull();
result = assertQuery(newQuery(domain).withLimit(2), user1, user2);
assertThat(result.get(result.size() - 1)._moreAccounts).isTrue();
}
@Test