use of pro.taskana.security.WithAccessId in project taskana by Taskana.
the class QueryWorkbasketAccessItemsAccTest method testQueryAccessItemsByWorkbasketKey.
@WithAccessId(userName = "dummy", groupNames = { "businessadmin" })
@Test
public void testQueryAccessItemsByWorkbasketKey() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketAccessItem> results = workbasketService.createWorkbasketAccessItemQuery().workbasketIdIn("WBI:100000000000000000000000000000000006").list();
Assert.assertEquals(3L, results.size());
}
use of pro.taskana.security.WithAccessId in project taskana by Taskana.
the class QueryWorkbasketAccessItemsAccTest method testQueryAccessItemsForAccessIds.
@WithAccessId(userName = "dummy", groupNames = { "businessadmin" })
@Test
public void testQueryAccessItemsForAccessIds() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketAccessItem> results = workbasketService.createWorkbasketAccessItemQuery().accessIdIn("user_1_1", "group_1").list();
Assert.assertEquals(8L, results.size());
}
use of pro.taskana.security.WithAccessId in project taskana by Taskana.
the class QueryWorkbasketAccessItemsAccTest method testQueryAccessItemsByWorkbasketKeyOrderedDescending.
@WithAccessId(userName = "dummy", groupNames = { "businessadmin" })
@Test
public void testQueryAccessItemsByWorkbasketKeyOrderedDescending() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketAccessItem> results = workbasketService.createWorkbasketAccessItemQuery().workbasketIdIn("WBI:100000000000000000000000000000000006").orderByWorkbasketId(desc).orderByAccessId(asc).list();
Assert.assertEquals(3L, results.size());
Assert.assertEquals("WAI:100000000000000000000000000000000009", results.get(0).getId());
}
use of pro.taskana.security.WithAccessId 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.security.WithAccessId 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));
}
Aggregations