use of pro.taskana.WorkbasketSummary in project taskana by Taskana.
the class WorkbasketQueryAccTest method testQueryWorkbasketByUnauthenticated.
@Test
public void testQueryWorkbasketByUnauthenticated() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().nameLike("%").list();
Assert.assertEquals(0L, results.size());
try {
results = workbasketService.createWorkbasketQuery().nameLike("%").accessIdsHavePermission(WorkbasketPermission.TRANSFER, "teamlead_1", "group_1", "group_2").list();
Assert.fail("NotAuthrorizedException was expected");
} catch (NotAuthorizedException ex) {
}
}
use of pro.taskana.WorkbasketSummary in project taskana by Taskana.
the class QueryWorkbasketAccTest method testQueryWorkbasketByOwnerLike.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByOwnerLike() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().ownerLike("%an%", "%te%").orderByOwner(asc).list();
Assert.assertEquals(1L, results.size());
}
use of pro.taskana.WorkbasketSummary in project taskana by Taskana.
the class QueryWorkbasketAccTest method testQueryWorkbasketByNameContainsCaseInsensitive.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByNameContainsCaseInsensitive() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().nameLike("%TEAMLEAD%").list();
Assert.assertEquals(2L, results.size());
}
use of pro.taskana.WorkbasketSummary in project taskana by Taskana.
the class QueryWorkbasketAccTest method testQueryWorkbasketByKeyContainsIgnoreCase.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByKeyContainsIgnoreCase() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().keyLike("%kSc%").list();
Assert.assertEquals(3L, results.size());
}
use of pro.taskana.WorkbasketSummary in project taskana by Taskana.
the class QueryWorkbasketAccTest method testQueryWorkbasketByNameStartsWithSortedByNameDescending.
@WithAccessId(userName = "max")
@Test
public void testQueryWorkbasketByNameStartsWithSortedByNameDescending() throws SQLException, NotAuthorizedException, InvalidArgumentException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().nameLike("basxet%").orderByName(desc).list();
Assert.assertEquals(10L, results.size());
// check sort order is correct
WorkbasketSummary previousSummary = null;
for (WorkbasketSummary wbSummary : results) {
if (previousSummary != null) {
Assert.assertTrue(wbSummary.getName().compareToIgnoreCase(previousSummary.getName()) <= 0);
}
previousSummary = wbSummary;
}
}
Aggregations