Search in sources :

Example 51 with ClassificationSummary

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));
}
Also used : ClassificationSummary(pro.taskana.ClassificationSummary) ClassificationService(pro.taskana.ClassificationService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Aggregations

ClassificationSummary (pro.taskana.ClassificationSummary)51 Test (org.junit.Test)38 AbstractAccTest (acceptance.AbstractAccTest)21 Classification (pro.taskana.Classification)20 ClassificationService (pro.taskana.ClassificationService)20 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)14 Connection (java.sql.Connection)7 Attachment (pro.taskana.Attachment)7 Duration (java.time.Duration)5 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)5 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Collectors (java.util.stream.Collectors)4 Task (pro.taskana.Task)4 ClassificationNotFoundException (pro.taskana.exceptions.ClassificationNotFoundException)4 SystemException (pro.taskana.exceptions.SystemException)4 WithAccessId (pro.taskana.security.WithAccessId)4 PersistenceException (org.apache.ibatis.exceptions.PersistenceException)3 SQLException (java.sql.SQLException)2