use of pro.taskana.TaskService 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);
}
use of pro.taskana.TaskService in project taskana by Taskana.
the class TransferTaskAccTest method testTransferTaskToWorkbasketKeyDomain.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testTransferTaskToWorkbasketKeyDomain() throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException, InvalidStateException, InvalidOwnerException {
TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000003");
taskService.claim(task.getId());
taskService.setTaskRead(task.getId(), true);
taskService.transfer(task.getId(), "USER_1_1", "DOMAIN_A");
Task transferredTask = taskService.getTask("TKI:000000000000000000000000000000000003");
assertNotNull(transferredTask);
assertTrue(transferredTask.isTransferred());
assertFalse(transferredTask.isRead());
assertEquals(TaskState.READY, transferredTask.getState());
}
use of pro.taskana.TaskService in project taskana by Taskana.
the class TransferTaskAccTest method testThrowsExceptionIfTransferWithNoTransferAuthorization.
@WithAccessId(userName = "user_1_1", groupNames = { "group_1" })
@Test(expected = NotAuthorizedException.class)
public void testThrowsExceptionIfTransferWithNoTransferAuthorization() throws SQLException, NotAuthorizedException, InvalidArgumentException, ClassificationNotFoundException, WorkbasketNotFoundException, TaskAlreadyExistException, InvalidWorkbasketException, TaskNotFoundException {
TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000001");
taskService.transfer(task.getId(), "WBI:100000000000000000000000000000000005");
}
use of pro.taskana.TaskService in project taskana by Taskana.
the class DeleteTaskAccTest method testThrowsExceptionIfTaskIsNotCompleted.
@WithAccessId(userName = "user_1_2", groupNames = { "group_1", "admin" })
@Test(expected = InvalidStateException.class)
public void testThrowsExceptionIfTaskIsNotCompleted() throws TaskNotFoundException, InvalidStateException, SQLException, NotAuthorizedException {
TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000029");
taskService.deleteTask(task.getId());
}
use of pro.taskana.TaskService in project taskana by Taskana.
the class DeleteTaskAccTest method testDeleteSingleTask.
@WithAccessId(userName = "user_1_2", groupNames = { "group_1", "admin" })
@Test(expected = TaskNotFoundException.class)
public void testDeleteSingleTask() throws TaskNotFoundException, InvalidStateException, NotAuthorizedException {
TaskService taskService = taskanaEngine.getTaskService();
Task task = taskService.getTask("TKI:000000000000000000000000000000000036");
taskService.deleteTask(task.getId());
taskService.getTask("TKI:000000000000000000000000000000000036");
}
Aggregations