Package org.jboss.aerogear.controller.router.rest.pagination

Examples of org.jboss.aerogear.controller.router.rest.pagination.PaginationProperties.offset()


public class PagingPropertiesTest {

    @Test
    public void offset() {
        final PaginationProperties params = new PaginationProperties(10, 25, 100);
        assertThat(params.offset()).isEqualTo(10);
        assertThat(params.limit()).isEqualTo(25);
        assertThat(params.total().get()).isEqualTo(100);
    }

    @Test
View Full Code Here


    @Test
    public void nextOffset() {
        final PaginationProperties params = new PaginationProperties(14, 10, 30);
        assertThat(params.nextOffset()).isEqualTo(24);
        assertThat(params.offset()).isEqualTo(14);
        assertThat(params.limit()).isEqualTo(10);
        assertThat(params.total().get()).isEqualTo(30);
    }

    @Test
View Full Code Here

    @Test
    public void nextOffsetLastPage() {
        final PaginationProperties params = new PaginationProperties(90, 10, 100);
        assertThat(params.nextOffset()).isEqualTo(100);
        assertThat(params.offset()).isEqualTo(90);
        assertThat(params.limit()).isEqualTo(10);
        assertThat(params.total().get()).isEqualTo(100);
        assertThat(params.isLastOffset()).isTrue();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.