Search in sources :

Example 1 with Paginate

use of com.yahoo.elide.annotation.Paginate in project elide by yahoo.

the class PaginationImplTest method testClassLevelOverride.

@Test
public void testClassLevelOverride() {
    @Paginate(maxLimit = 100000, defaultLimit = 10)
    class PaginationOverrideTest {
    }
    MultivaluedMap<String, String> queryParams = new MultivaluedStringMap();
    PaginationImpl pageData = PaginationImpl.parseQueryParams(ClassType.of(PaginationOverrideTest.class), queryParams, new ElideSettingsBuilder(null).withEntityDictionary(EntityDictionary.builder().build()).withDefaultPageSize(1).withDefaultMaxPageSize(1).build());
    assertEquals(0, pageData.getOffset());
    assertEquals(10, pageData.getLimit());
}
Also used : ElideSettingsBuilder(com.yahoo.elide.ElideSettingsBuilder) MultivaluedStringMap(org.glassfish.jersey.internal.util.collection.MultivaluedStringMap) Paginate(com.yahoo.elide.annotation.Paginate) Test(org.junit.jupiter.api.Test)

Aggregations

ElideSettingsBuilder (com.yahoo.elide.ElideSettingsBuilder)1 Paginate (com.yahoo.elide.annotation.Paginate)1 MultivaluedStringMap (org.glassfish.jersey.internal.util.collection.MultivaluedStringMap)1 Test (org.junit.jupiter.api.Test)1