Search in sources :

Example 96 with WithAccessId

use of pro.taskana.security.WithAccessId in project taskana by Taskana.

the class QueryWorkbasketAccTest method testQueryWorkbasketByNameContains.

@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByNameContains() throws SQLException, NotAuthorizedException, InvalidArgumentException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().nameLike("%Teamlead%", "%Gruppenpostkorb KSC%").list();
    Assert.assertEquals(5L, results.size());
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) WorkbasketSummary(pro.taskana.WorkbasketSummary) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Example 97 with WithAccessId

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

Example 98 with WithAccessId

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

Example 99 with WithAccessId

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

Example 100 with WithAccessId

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

Aggregations

Test (org.junit.Test)216 WithAccessId (pro.taskana.security.WithAccessId)216 AbstractAccTest (acceptance.AbstractAccTest)201 TaskService (pro.taskana.TaskService)100 WorkbasketService (pro.taskana.WorkbasketService)78 Task (pro.taskana.Task)57 WorkbasketSummary (pro.taskana.WorkbasketSummary)51 TaskSummary (pro.taskana.TaskSummary)47 TaskanaEngineProxyForTest (pro.taskana.impl.TaskanaEngineProxyForTest)34 Workbasket (pro.taskana.Workbasket)23 Classification (pro.taskana.Classification)21 KeyDomain (pro.taskana.KeyDomain)19 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)19 ArrayList (java.util.ArrayList)17 Instant (java.time.Instant)16 WorkbasketAccessItem (pro.taskana.WorkbasketAccessItem)16 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)15 Connection (java.sql.Connection)10 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)9 TimeInterval (pro.taskana.TimeInterval)8