use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketByPermissionAccTest method testQueryAllTransferTargetsForUserAndGroupFromSubject.
@WithAccessId(userName = "user_1_1", groupNames = { "group_1" })
@Test
public void testQueryAllTransferTargetsForUserAndGroupFromSubject() throws SQLException, NotAuthorizedException, SystemException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().callerHasPermission(WorkbasketPermission.APPEND).list();
Assert.assertEquals(6, results.size());
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketByPermissionAccTest method testQueryAllTransferTargetsForUser.
@WithAccessId(userName = "dummy", groupNames = { "businessadmin" })
@Test
public void testQueryAllTransferTargetsForUser() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().accessIdsHavePermission(WorkbasketPermission.APPEND, "user_1_1").list();
Assert.assertEquals(1, results.size());
Assert.assertEquals("USER_1_1", results.get(0).getKey());
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class UpdateWorkbasketAccTest method testUpdateWorkbasket.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1", "businessadmin" })
@Test
public void testUpdateWorkbasket() throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException, InvalidWorkbasketException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.getWorkbasket("GPK_KSC", "DOMAIN_A");
Instant modified = workbasket.getModified();
workbasket.setName("new name");
workbasket.setDescription("new description");
workbasket.setType(WorkbasketType.TOPIC);
workbasket.setOrgLevel1("new level 1");
workbasket.setOrgLevel2("new level 2");
workbasket.setOrgLevel3("new level 3");
workbasket.setOrgLevel4("new level 4");
workbasket.setCustom1("new custom 1");
workbasket.setCustom2("new custom 2");
workbasket.setCustom3("new custom 3");
workbasket.setCustom4("new custom 4");
workbasket.setDescription("new description");
workbasketService.updateWorkbasket(workbasket);
Workbasket updatedWorkbasket = workbasketService.getWorkbasket("GPK_KSC", "DOMAIN_A");
Assert.assertEquals(workbasket.getId(), updatedWorkbasket.getId());
Assert.assertEquals(workbasket.getCreated(), updatedWorkbasket.getCreated());
Assert.assertNotEquals(modified, updatedWorkbasket.getModified());
Assert.assertEquals("new name", updatedWorkbasket.getName());
Assert.assertEquals(WorkbasketType.TOPIC, updatedWorkbasket.getType());
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class UpdateWorkbasketAccTest method testCheckAuthorizationToUpdateWorkbasket.
@WithAccessId(userName = "user_1_1", groupNames = { "group_1" })
@Test(expected = NotAuthorizedException.class)
public void testCheckAuthorizationToUpdateWorkbasket() throws SQLException, NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException, InvalidWorkbasketException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.getWorkbasket("USER_1_1", "DOMAIN_A");
workbasket.setName("new name");
workbasketService.updateWorkbasket(workbasket);
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketByPermissionAccTest method testQueryAllAvailableWorkbasketForOpeningForUserAndGroupFromSubject.
@WithAccessId(userName = "user_1_1")
@Test
public void testQueryAllAvailableWorkbasketForOpeningForUserAndGroupFromSubject() throws SQLException, NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().callerHasPermission(WorkbasketPermission.READ).list();
Assert.assertEquals(1, results.size());
}
Aggregations