use of pro.taskana.KeyDomain in project taskana by Taskana.
the class QueryTasksWithPaginationAccTest method testPaginationNullAndNegativeLimitsIgnoring.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testPaginationNullAndNegativeLimitsIgnoring() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
// 0 limit/size = 0 results
int pageNumber = 2;
int pageSize = 0;
List<TaskSummary> results = taskService.createTaskQuery().workbasketKeyDomainIn(new KeyDomain("GPK_KSC", "DOMAIN_A")).listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(0));
// Negative size will be 0 = 0 results
pageNumber = 2;
pageSize = -1;
results = taskService.createTaskQuery().workbasketKeyDomainIn(new KeyDomain("GPK_KSC", "DOMAIN_A")).listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(0));
// Negative page = first page
pageNumber = -1;
pageSize = 10;
results = taskService.createTaskQuery().workbasketKeyDomainIn(new KeyDomain("GPK_KSC", "DOMAIN_A")).listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(10));
}
use of pro.taskana.KeyDomain in project taskana by Taskana.
the class QueryTasksWithPaginationAccTest method testGetFirstPageOfTaskQueryWithOffset.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testGetFirstPageOfTaskQueryWithOffset() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().workbasketKeyDomainIn(new KeyDomain("GPK_KSC", "DOMAIN_A")).list(0, 10);
assertThat(results.size(), equalTo(10));
}
use of pro.taskana.KeyDomain in project taskana by Taskana.
the class QueryTasksWithPaginationAccTest 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 SQLException
* @throws NotAuthorizedException
* @throws InvalidArgumentException
*/
@Ignore
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test(expected = TaskanaRuntimeException.class)
public void testPaginationThrowingExceptionWhenPageOutOfBounds() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
// entrypoint set outside result amount
int pageNumber = 6;
int pageSize = 10;
taskService.createTaskQuery().workbasketKeyDomainIn(new KeyDomain("GPK_KSC", "DOMAIN_A")).listPage(pageNumber, pageSize);
}
Aggregations