use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketAccessItemsAccTest method testQueryWorkbasketAccessItemValuesForColumnName.
@WithAccessId(userName = "dummy", groupNames = { "businessadmin" })
@Test
public void testQueryWorkbasketAccessItemValuesForColumnName() throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<String> columnValueList = workbasketService.createWorkbasketAccessItemQuery().listValues("WORKBASKET_ID", null);
assertNotNull(columnValueList);
assertEquals(23, columnValueList.size());
columnValueList = workbasketService.createWorkbasketAccessItemQuery().listValues("ACCESS_ID", null);
assertNotNull(columnValueList);
assertEquals(9, columnValueList.size());
long countEntries = workbasketService.createWorkbasketAccessItemQuery().count();
// DISTINCT
assertTrue(columnValueList.size() < countEntries);
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketsWithPaginationAccTest method testGetFirstPageOfWorkbasketQueryWithOffset.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testGetFirstPageOfWorkbasketQueryWithOffset() throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").list(0, 5);
assertThat(results.size(), equalTo(5));
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketsWithPaginationAccTest method testPaginationWithPages.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testPaginationWithPages() throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
// Getting full page
int pageNumber = 2;
int pageSize = 4;
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(4));
// Getting full page
pageNumber = 4;
pageSize = 1;
results = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(1));
// Getting last results on 1 big page
pageNumber = 1;
pageSize = 100;
results = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(8));
// Getting last results on multiple pages
pageNumber = 2;
pageSize = 5;
results = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(3));
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketsWithPaginationAccTest method testWorkbasketQueryDomA.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testWorkbasketQueryDomA() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> result = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").list();
assertThat(result.size(), equalTo(8));
}
use of pro.taskana.WorkbasketService in project taskana by Taskana.
the class QueryWorkbasketsWithPaginationAccTest method testPaginationNullAndNegativeLimitsIgnoring.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testPaginationNullAndNegativeLimitsIgnoring() throws NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
// 0 limit/size = 0 results
int pageNumber = 2;
int pageSize = 0;
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(0));
// Negative size will be 0 = 0 results
pageNumber = 2;
pageSize = -1;
results = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(0));
// Negative page = first page
pageNumber = -1;
pageSize = 10;
results = workbasketService.createWorkbasketQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(8));
}
Aggregations