Search in sources :

Example 56 with WorkbasketService

use of pro.taskana.WorkbasketService in project taskana by Taskana.

the class QueryWorkbasketAccTest method testQueryWorkbasketByKeyOrNameContainsIgnoreCase.

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

Example 57 with WorkbasketService

use of pro.taskana.WorkbasketService in project taskana by Taskana.

the class QueryWorkbasketAccTest method testQueryWorkbasketByDomainAndType.

@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByDomainAndType() throws SQLException, NotAuthorizedException, InvalidArgumentException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").typeIn(WorkbasketType.PERSONAL).list();
    Assert.assertEquals(6L, 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 58 with WorkbasketService

use of pro.taskana.WorkbasketService in project taskana by Taskana.

the class QueryWorkbasketAccTest method testQueryWorkbasketByNameStartsWithSortedByKeyAscending.

@WithAccessId(userName = "max")
@Test
public void testQueryWorkbasketByNameStartsWithSortedByKeyAscending() throws SQLException, NotAuthorizedException, InvalidArgumentException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().nameLike("basxet%").orderByKey(asc).list();
    Assert.assertEquals(10L, results.size());
    // check sort order is correct
    WorkbasketSummary previousSummary = null;
    for (WorkbasketSummary wbSummary : results) {
        if (previousSummary != null) {
            Assert.assertTrue(wbSummary.getKey().compareToIgnoreCase(previousSummary.getKey()) >= 0);
        }
        previousSummary = wbSummary;
    }
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) WorkbasketSummary(pro.taskana.WorkbasketSummary) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Example 59 with WorkbasketService

use of pro.taskana.WorkbasketService in project taskana by Taskana.

the class QueryWorkbasketAccTest method testQueryWorkbasketByMultipleKeys.

@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByMultipleKeys() throws SQLException, NotAuthorizedException, InvalidArgumentException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().keyIn("GPK_KSC_1", "GPK_KSC").list();
    Assert.assertEquals(2L, 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 60 with WorkbasketService

use of pro.taskana.WorkbasketService in project taskana by Taskana.

the class QueryWorkbasketsWithPaginationAccTest method testGetSecondPageOfWorkbasketQueryWithOffset.

@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testGetSecondPageOfWorkbasketQueryWithOffset() throws NotAuthorizedException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").list(5, 5);
    assertThat(results.size(), equalTo(3));
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) WorkbasketSummary(pro.taskana.WorkbasketSummary) 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