use of org.molgenis.api.model.response.LinksResponse 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.LinksResponse in project molgenis by molgenis.
the class LinksUtilsTest method createLinksResponse.
@Test
void createLinksResponse() throws URISyntaxException {
request.setQueryString("page=1");
LinksResponse linksResponse = LinksResponse.builder().setPrevious(new URI("http://localhost?page=0")).setSelf(new URI("http://localhost?page=1")).setNext(new URI("http://localhost?page=2")).build();
assertEquals(linksResponse, LinksUtils.createLinksResponse(1, 10, 30));
}
use of org.molgenis.api.model.response.LinksResponse in project molgenis by molgenis.
the class LinksUtilsTest method createLinksResponseFirstPage.
@Test
void createLinksResponseFirstPage() throws URISyntaxException {
request.setQueryString("page=0");
LinksResponse linksResponse = LinksResponse.builder().setSelf(new URI("http://localhost?page=0")).setNext(new URI("http://localhost?page=1")).build();
assertEquals(linksResponse, LinksUtils.createLinksResponse(0, 10, 30));
}
Aggregations