use of io.crnk.core.resource.meta.DefaultHasMoreResourcesMetaInformation in project crnk-framework by crnk-project.
the class HasNextPageTestRepository method findAll.
@Override
public ResourceList<Task> findAll(QuerySpec querySpec) {
DefaultResourceList<Task> list = new DefaultResourceList<>();
list.setMeta(new DefaultHasMoreResourcesMetaInformation());
querySpec.apply(tasks, list);
return list;
}
use of io.crnk.core.resource.meta.DefaultHasMoreResourcesMetaInformation in project crnk-framework by crnk-project.
the class HasNextPageTestRepository method findAll.
@Override
public ResourceList<Task> findAll(Iterable<Long> ids, QuerySpec querySpec) {
DefaultResourceList<Task> list = new DefaultResourceList<>();
list.setMeta(new DefaultHasMoreResourcesMetaInformation());
querySpec.apply(tasks, list);
return list;
}
use of io.crnk.core.resource.meta.DefaultHasMoreResourcesMetaInformation in project crnk-framework by crnk-project.
the class InMemoryEvaluatorTest method testNextPageMetaInformationIsTrue.
@Test
public void testNextPageMetaInformationIsTrue() {
QuerySpec spec = new QuerySpec(Task.class);
DefaultResourceList<Task> results = new DefaultResourceList<>();
results.setMeta(new DefaultHasMoreResourcesMetaInformation());
spec.setLimit(2L);
spec.apply(tasks, results);
Assert.assertEquals(2, results.size());
HasMoreResourcesMetaInformation meta = results.getMeta(HasMoreResourcesMetaInformation.class);
Assert.assertTrue(meta.getHasMoreResources());
}
use of io.crnk.core.resource.meta.DefaultHasMoreResourcesMetaInformation in project crnk-framework by crnk-project.
the class InMemoryEvaluatorTest method testNextPageMetaInformationIsFalse.
@Test
public void testNextPageMetaInformationIsFalse() {
QuerySpec spec = new QuerySpec(Task.class);
DefaultResourceList<Task> results = new DefaultResourceList<>();
results.setMeta(new DefaultHasMoreResourcesMetaInformation());
spec.setLimit(5L);
spec.apply(tasks, results);
HasMoreResourcesMetaInformation meta = results.getMeta(HasMoreResourcesMetaInformation.class);
Assert.assertEquals(5, results.size());
Assert.assertFalse(meta.getHasMoreResources());
}
Aggregations