Search in sources :

Example 21 with WorkbasketService

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));
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Example 22 with WorkbasketService

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");
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Example 23 with WorkbasketService

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");
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 24 with WorkbasketService

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");
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 25 with WorkbasketService

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));
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) WorkbasketPermission(pro.taskana.WorkbasketPermission) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Aggregations

AbstractAccTest (acceptance.AbstractAccTest)84 Test (org.junit.Test)84 WorkbasketService (pro.taskana.WorkbasketService)84 WithAccessId (pro.taskana.security.WithAccessId)78 WorkbasketSummary (pro.taskana.WorkbasketSummary)52 Workbasket (pro.taskana.Workbasket)12 WorkbasketAccessItem (pro.taskana.WorkbasketAccessItem)11 ArrayList (java.util.ArrayList)8 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)7 InvalidWorkbasketException (pro.taskana.exceptions.InvalidWorkbasketException)5 WorkbasketNotFoundException (pro.taskana.exceptions.WorkbasketNotFoundException)5 SQLException (java.sql.SQLException)4 Task (pro.taskana.Task)4 TaskService (pro.taskana.TaskService)4 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)4 List (java.util.List)3 Assert.assertTrue (org.junit.Assert.assertTrue)3 Assert.fail (org.junit.Assert.fail)3 Ignore (org.junit.Ignore)3 RunWith (org.junit.runner.RunWith)3