use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketAccTest method testQueryAllForBusinessAdminMultipleTimes.
@WithAccessId(userName = "teamlead_1", groupNames = { "businessadmin" })
@Test
public void testQueryAllForBusinessAdminMultipleTimes() {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
WorkbasketQuery query = workbasketService.createWorkbasketQuery();
long count = query.count();
assertTrue(count == 24);
List<WorkbasketSummary> workbaskets = query.list();
assertNotNull(workbaskets);
assertEquals(count, workbaskets.size());
workbaskets = query.list();
assertNotNull(workbaskets);
assertEquals(count, workbaskets.size());
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketAccTest method testQueryWorkbasketByCreated.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByCreated() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().createdWithin(todaysInterval()).list();
Assert.assertEquals(8L, results.size());
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketByPermissionAccTest method testQueryAllTransferTargetsForUserAndGroupSortedByNameAscending.
@WithAccessId(userName = "dummy", groupNames = { "businessadmin" })
@Test
public void testQueryAllTransferTargetsForUserAndGroupSortedByNameAscending() throws SQLException, NotAuthorizedException, InvalidArgumentException, SystemException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().accessIdsHavePermission(WorkbasketPermission.APPEND, "user_1_1", "group_1").orderByName(asc).list();
Assert.assertEquals(6, results.size());
Assert.assertEquals("GPK_KSC_1", results.get(0).getKey());
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketByPermissionAccTest method testQueryAllTransferTargetsForUserAndGroup.
@WithAccessId(userName = "dummy", groupNames = { "businessadmin" })
@Test
public void testQueryAllTransferTargetsForUserAndGroup() throws SQLException, NotAuthorizedException, InvalidArgumentException, SystemException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().accessIdsHavePermission(WorkbasketPermission.APPEND, "user_1_1", "group_1").list();
Assert.assertEquals(6, results.size());
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketByPermissionAccTest method testQueryAllTransferTargetsForUserNotAuthorized.
@WithAccessId(userName = "dummy")
@Test(expected = NotAuthorizedException.class)
public void testQueryAllTransferTargetsForUserNotAuthorized() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
workbasketService.createWorkbasketQuery().accessIdsHavePermission(WorkbasketPermission.APPEND, "user_1_1").list();
fail("NotAuthorizedException was expected");
}
Aggregations