QueryAccounts: Support parameter 'start'

The 'start' query parameter can be supplied to skip a number of
accounts from the list.

Change-Id: I31497d0db3ac6049a645fe2d29984797bd6cfcae
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2016-06-30 14:21:19 +02:00
parent afa0be9b96
commit 6115eae5d0
6 changed files with 44 additions and 1 deletions

View File

@@ -256,6 +256,17 @@ public abstract class AbstractQueryAccountsTest extends GerritServerTests {
assertQuery(newQuery(domain).withLimit(2), user1, user2);
}
@Test
public void withStart() throws Exception {
String domain = name("test.com");
AccountInfo user1 = newAccountWithEmail("user1", "user1@" + domain);
AccountInfo user2 = newAccountWithEmail("user2", "user2@" + domain);
AccountInfo user3 = newAccountWithEmail("user3", "user3@" + domain);
assertQuery(domain, user1, user2, user3);
assertQuery(newQuery(domain).withStart(1), user2, user3);
}
protected AccountInfo newAccount(String username) throws Exception {
return newAccountWithEmail(username, null);
}