use of org.molgenis.api.model.response.PageResponse in project molgenis by molgenis.
the class PageUtilsTest method getPageResponse.
@Test
void getPageResponse() {
PageResponse pageResponse = PageResponse.builder().setSize(10).setNumber(0).setTotalPages(9).setTotalElements(90).build();
assertEquals(pageResponse, PageUtils.getPageResponse(10, 0, 90));
}
use of org.molgenis.api.model.response.PageResponse in project molgenis by molgenis.
the class PermissionResponseUtils method getPermissionResponse.
static PagedApiResponse getPermissionResponse(String query, int page, int pageSize, int totalItems, Object data) {
PageResponse pageResponse = PageResponse.create(pageSize, totalItems, page);
LinksResponse linksResponse = getLinks(query, page, pageSize, totalItems);
return PagedApiResponse.create(pageResponse, linksResponse, data);
}
use of org.molgenis.api.model.response.PageResponse in project molgenis by molgenis.
the class PageUtilsTest method getPageResponseTotalPagesRounding.
@Test
void getPageResponseTotalPagesRounding() {
PageResponse pageResponse = PageResponse.builder().setSize(10).setNumber(0).setTotalPages(9).setTotalElements(89).build();
assertEquals(pageResponse, PageUtils.getPageResponse(10, 0, 89));
}
Aggregations