Search in sources :

Example 91 with WithAccessId

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

the class DistributionTargetsAccTest method testGetDistributionSourcesByKeyDomain.

@WithAccessId(userName = "user_2_2", groupNames = { "group_1", "group_2" })
@Test
public void testGetDistributionSourcesByKeyDomain() throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, SQLException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> distributionSources = workbasketService.getDistributionSources("TEAMLEAD_1", "DOMAIN_A");
    assertEquals(2, distributionSources.size());
    List<String> expectedIds = new ArrayList<>(Arrays.asList("WBI:100000000000000000000000000000000001", "WBI:100000000000000000000000000000000002"));
    for (WorkbasketSummary foundSummary : distributionSources) {
        assertTrue(expectedIds.contains(foundSummary.getId()));
    }
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) ArrayList(java.util.ArrayList) WorkbasketSummary(pro.taskana.WorkbasketSummary) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Example 92 with WithAccessId

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

the class DistributionTargetsAccTest method testQueryDistributionSourcesThrowsWorkbasketNotFound.

@WithAccessId(userName = "user_2_2", groupNames = { "group_1", "group_2" })
@Test(expected = WorkbasketNotFoundException.class)
public void testQueryDistributionSourcesThrowsWorkbasketNotFound() throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, SQLException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> distributionSources = workbasketService.getDistributionSources("WBI:10dasgibtsdochnicht00000000000000004");
    assertEquals(2, distributionSources.size());
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) WorkbasketSummary(pro.taskana.WorkbasketSummary) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Example 93 with WithAccessId

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

the class QueryWorkbasketAccTest method testQueryWorkbasketByModified.

@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByModified() throws SQLException, NotAuthorizedException, InvalidArgumentException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().modifiedWithin(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 94 with WithAccessId

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

the class QueryWorkbasketAccTest method testQueryWorkbasketValuesForColumnName.

@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketValuesForColumnName() throws NotAuthorizedException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<String> columnValueList = workbasketService.createWorkbasketQuery().listValues("NAME", null);
    assertNotNull(columnValueList);
    assertEquals(9, columnValueList.size());
    columnValueList = workbasketService.createWorkbasketQuery().nameLike("%korb%").orderByName(asc).listValues("NAME", // will override
    SortDirection.DESCENDING);
    assertNotNull(columnValueList);
    assertEquals(3, columnValueList.size());
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Example 95 with WithAccessId

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

the class QueryWorkbasketAccTest method testQueryWorkbasketByDescription.

@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByDescription() throws SQLException, NotAuthorizedException, InvalidArgumentException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().descriptionLike("%ppk%", "%gruppen%").orderByType(desc).orderByDescription(asc).list();
    Assert.assertEquals(9L, 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