use of pro.taskana.ClassificationSummary in project taskana by Taskana.
the class QueryClassificationWithPaginationAccTest method testPaginationNullAndNegativeLimitsIgnoring.
@Test
public void testPaginationNullAndNegativeLimitsIgnoring() throws NotAuthorizedException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
// 0 limit/size = 0 results
int pageNumber = 1;
int pageSize = 0;
List<ClassificationSummary> results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(0));
// Negative will be 0 = all results
pageNumber = 1;
pageSize = -1;
results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(0));
// Negative page = first page
pageNumber = -1;
pageSize = 10;
results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(10));
}
Aggregations