Search in sources :

Example 31 with ClassificationService

use of pro.taskana.ClassificationService in project taskana by Taskana.

the class QueryClassificationWithPaginationAccTest method testPaginationThrowingExceptionWhenPageOutOfBounds.

/**
 * Testcase only for DB2 users, because H2 doesn´t throw a Exception when the offset is set to high.<br>
 * Using DB2 should throw a unchecked RuntimeException for a offset which is out of bounds.
 *
 * @throws NotAuthorizedException
 */
@Ignore
@Test(expected = TaskanaRuntimeException.class)
public void testPaginationThrowingExceptionWhenPageOutOfBounds() throws NotAuthorizedException {
    ClassificationService classificationService = taskanaEngine.getClassificationService();
    // entrypoint set outside result amount
    int pageNumber = 5;
    int pageSize = 10;
    classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
}
Also used : ClassificationService(pro.taskana.ClassificationService) Ignore(org.junit.Ignore) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 32 with ClassificationService

use of pro.taskana.ClassificationService in project taskana by Taskana.

the class QueryClassificationWithPaginationAccTest method testCountOfClassificationsQuery.

@Test
public void testCountOfClassificationsQuery() throws NotAuthorizedException {
    ClassificationService classificationService = taskanaEngine.getClassificationService();
    long count = classificationService.createClassificationQuery().domainIn("DOMAIN_A").count();
    assertThat(count, equalTo(17L));
}
Also used : ClassificationService(pro.taskana.ClassificationService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Aggregations

AbstractAccTest (acceptance.AbstractAccTest)32 Test (org.junit.Test)32 ClassificationService (pro.taskana.ClassificationService)32 ClassificationSummary (pro.taskana.ClassificationSummary)19 Classification (pro.taskana.Classification)10 WithAccessId (pro.taskana.security.WithAccessId)6 SQLException (java.sql.SQLException)2 Instant (java.time.Instant)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 Assert.assertEquals (org.junit.Assert.assertEquals)2 Assert.assertNotNull (org.junit.Assert.assertNotNull)2 ClassificationNotFoundException (pro.taskana.exceptions.ClassificationNotFoundException)2 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)2 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)2 ArrayList (java.util.ArrayList)1 Ignore (org.junit.Ignore)1 Task (pro.taskana.Task)1 TaskService (pro.taskana.TaskService)1 DaysToWorkingDaysConverter (pro.taskana.impl.DaysToWorkingDaysConverter)1