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());
}
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());
}
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;
}
}
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());
}
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));
}
Aggregations