use of pro.taskana.WorkbasketAccessItem in project taskana by Taskana.
the class WorkbasketServiceImplIntExplicitTest method testInsertWorkbasketAccessUser.
@WithAccessId(userName = "Elena", groupNames = { "businessadmin" })
@Test
public void testInsertWorkbasketAccessUser() throws NotAuthorizedException, SQLException, InvalidArgumentException {
Connection connection = dataSource.getConnection();
taskanaEngineImpl.setConnection(connection);
workBasketService = taskanaEngine.getWorkbasketService();
WorkbasketAccessItem accessItem = workBasketService.newWorkbasketAccessItem("Key1", "Arthur Dent");
accessItem.setPermOpen(true);
accessItem.setPermRead(true);
workBasketService.createWorkbasketAccessItem(accessItem);
Assert.assertEquals(1, workBasketService.getWorkbasketAccessItems("Key1").size());
connection.commit();
}
use of pro.taskana.WorkbasketAccessItem in project taskana by Taskana.
the class QueryWorkbasketAccessItemsAccTest method testQueryAccessItemsForAccessIdsAndWorkbasketKey.
@WithAccessId(userName = "dummy", groupNames = { "businessadmin" })
@Test
public void testQueryAccessItemsForAccessIdsAndWorkbasketKey() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketAccessItem> results = workbasketService.createWorkbasketAccessItemQuery().accessIdIn("user_1_1", "group_1").workbasketIdIn("WBI:100000000000000000000000000000000006", "WBI:100000000000000000000000000000000002").list();
Assert.assertEquals(3L, results.size());
}
use of pro.taskana.WorkbasketAccessItem in project taskana by Taskana.
the class QueryWorkbasketAccessItemsAccTest method testQueryAccessItemsForAccessIdsOrderedAscending.
@WithAccessId(userName = "dummy", groupNames = { "businessadmin" })
@Test
public void testQueryAccessItemsForAccessIdsOrderedAscending() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
WorkbasketAccessItemQuery query = workbasketService.createWorkbasketAccessItemQuery().accessIdIn("user_1_1", "group_1").orderByAccessId(desc).orderByWorkbasketId(desc);
List<WorkbasketAccessItem> results = query.list();
long count = query.count();
Assert.assertEquals(8L, results.size());
Assert.assertEquals(results.size(), count);
Assert.assertEquals("WAI:100000000000000000000000000000000003", results.get(0).getId());
}
use of pro.taskana.WorkbasketAccessItem in project taskana by Taskana.
the class QueryWorkbasketAccessItemsAccTest method testQueryAccessItemsByWorkbasketKey.
@WithAccessId(userName = "dummy", groupNames = { "businessadmin" })
@Test
public void testQueryAccessItemsByWorkbasketKey() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketAccessItem> results = workbasketService.createWorkbasketAccessItemQuery().workbasketIdIn("WBI:100000000000000000000000000000000006").list();
Assert.assertEquals(3L, results.size());
}
use of pro.taskana.WorkbasketAccessItem in project taskana by Taskana.
the class QueryWorkbasketAccessItemsAccTest method testQueryAccessItemsForAccessIds.
@WithAccessId(userName = "dummy", groupNames = { "businessadmin" })
@Test
public void testQueryAccessItemsForAccessIds() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketAccessItem> results = workbasketService.createWorkbasketAccessItemQuery().accessIdIn("user_1_1", "group_1").list();
Assert.assertEquals(8L, results.size());
}
Aggregations