Search in sources :

Example 1 with QueryRequest

use of com.google.gerrit.extensions.api.changes.Changes.QueryRequest in project gerrit by GerritCodeReview.

the class AbstractQueryChangesTest method maxPages.

@Test
public void maxPages() throws Exception {
    TestRepository<Repo> repo = createProject("repo");
    Change change = insert(repo, newChange(repo));
    QueryRequest query = newQuery("status:new").withLimit(10);
    assertQuery(query, change);
    assertQuery(query.withStart(1));
    assertQuery(query.withStart(99));
    assertThatQueryException(query.withStart(100)).hasMessageThat().isEqualTo("Cannot go beyond page 10 of results");
    assertQuery(query.withLimit(100).withStart(100));
}
Also used : Repo(com.google.gerrit.testutil.InMemoryRepositoryManager.Repo) QueryRequest(com.google.gerrit.extensions.api.changes.Changes.QueryRequest) Change(com.google.gerrit.reviewdb.client.Change) Test(org.junit.Test)

Aggregations

QueryRequest (com.google.gerrit.extensions.api.changes.Changes.QueryRequest)1 Change (com.google.gerrit.reviewdb.client.Change)1 Repo (com.google.gerrit.testutil.InMemoryRepositoryManager.Repo)1 Test (org.junit.Test)1