use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketsWithPaginationAccTest method testCountOfWorkbasketQuery.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testCountOfWorkbasketQuery() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
long count = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").count();
assertThat(count, equalTo(8L));
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class UpdateWorkbasketAuthorizationsAccTest method testDeleteAccessItemsForAccessIdWithUnusedValuesThrowingNoException.
@WithAccessId(userName = "teamlead_1", groupNames = { "businessadmin" })
@Test
public void testDeleteAccessItemsForAccessIdWithUnusedValuesThrowingNoException() throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
workbasketService.deleteWorkbasketAccessItemsForAccessId("");
workbasketService.deleteWorkbasketAccessItemsForAccessId(null);
workbasketService.deleteWorkbasketAccessItemsForAccessId("123UNUSED456");
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class GetWorkbasketAccTest method testThrowsExceptionIfIdIsInvalid.
@Test(expected = WorkbasketNotFoundException.class)
public void testThrowsExceptionIfIdIsInvalid() throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException, InvalidWorkbasketException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
workbasketService.getWorkbasket("INVALID_ID");
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class GetWorkbasketAccTest method testThrowsExceptionIfNotAuthorized.
@Test(expected = NotAuthorizedException.class)
public void testThrowsExceptionIfNotAuthorized() throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException, InvalidWorkbasketException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
workbasketService.getWorkbasket("WBI:100000000000000000000000000000000001");
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class GetWorkbasketAccTest method testGetWorkbasketPermissions.
@WithAccessId(userName = "user_1_1", groupNames = { "group_1" })
@Test
public void testGetWorkbasketPermissions() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketPermission> permissions = workbasketService.getPermissionsForWorkbasket("WBI:100000000000000000000000000000000007");
Assert.assertEquals(4, permissions.size());
Assert.assertTrue(permissions.contains(WorkbasketPermission.READ));
Assert.assertTrue(permissions.contains(WorkbasketPermission.OPEN));
Assert.assertTrue(permissions.contains(WorkbasketPermission.TRANSFER));
Assert.assertTrue(permissions.contains(WorkbasketPermission.APPEND));
}
Aggregations