Exemplo n.º 1
0
  @Test
  public void maxPages() throws Exception {
    TestRepository<Repo> repo = createProject("repo");
    Change change = newChange(repo, null, null, null, null).insert();

    QueryRequest query = newQuery("status:new").withLimit(10);
    assertQuery(query, change);
    assertQuery(query.withStart(1));
    assertQuery(query.withStart(99));
    assertBadQuery(query.withStart(100));
    assertQuery(query.withLimit(100).withStart(100));
  }
Exemplo n.º 2
0
 protected List<ChangeInfo> assertQuery(QueryRequest query, Change... changes) throws Exception {
   List<ChangeInfo> result = query.get();
   Iterable<Integer> ids = ids(result);
   assertThat(ids).named(query.getQuery()).containsExactlyElementsIn(ids(changes)).inOrder();
   return result;
 }
Exemplo n.º 3
0
 protected void assertBadQuery(QueryRequest query) throws Exception {
   exception.expect(BadRequestException.class);
   query.get();
 }