Search in sources :

Example 16 with WorkbasketSummary

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

the class QueryWorkbasketAccTest method testQueryWorkbasketByModified.

@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByModified() throws SQLException, NotAuthorizedException, InvalidArgumentException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().modifiedWithin(todaysInterval()).list();
    Assert.assertEquals(8L, 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 17 with WorkbasketSummary

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

the class QueryWorkbasketAccTest method testQueryWorkbasketByDescription.

@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByDescription() throws SQLException, NotAuthorizedException, InvalidArgumentException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().descriptionLike("%ppk%", "%gruppen%").orderByType(desc).orderByDescription(asc).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 18 with WorkbasketSummary

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

the class QueryWorkbasketAccTest method testQueryWorkbasketByNameContains.

@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByNameContains() throws SQLException, NotAuthorizedException, InvalidArgumentException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().nameLike("%Teamlead%", "%Gruppenpostkorb KSC%").list();
    Assert.assertEquals(5L, 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 19 with WorkbasketSummary

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

the class QueryWorkbasketAccTest method testQueryAllForBusinessAdminMultipleTimes.

@WithAccessId(userName = "teamlead_1", groupNames = { "businessadmin" })
@Test
public void testQueryAllForBusinessAdminMultipleTimes() {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    WorkbasketQuery query = workbasketService.createWorkbasketQuery();
    long count = query.count();
    assertTrue(count == 24);
    List<WorkbasketSummary> workbaskets = query.list();
    assertNotNull(workbaskets);
    assertEquals(count, workbaskets.size());
    workbaskets = query.list();
    assertNotNull(workbaskets);
    assertEquals(count, workbaskets.size());
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) WorkbasketQuery(pro.taskana.WorkbasketQuery) WorkbasketSummary(pro.taskana.WorkbasketSummary) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Example 20 with WorkbasketSummary

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

the class QueryWorkbasketAccTest method testQueryWorkbasketByCreated.

@WithAccessId(userName = "teamlead_1", groupNames = { "group_1" })
@Test
public void testQueryWorkbasketByCreated() throws SQLException, NotAuthorizedException, InvalidArgumentException {
    WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
    List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery().createdWithin(todaysInterval()).list();
    Assert.assertEquals(8L, results.size());
}
Also used : WorkbasketService(pro.taskana.WorkbasketService) WorkbasketSummary(pro.taskana.WorkbasketSummary) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Aggregations

WorkbasketSummary (pro.taskana.WorkbasketSummary)66 Test (org.junit.Test)56 WorkbasketService (pro.taskana.WorkbasketService)53 AbstractAccTest (acceptance.AbstractAccTest)52 WithAccessId (pro.taskana.security.WithAccessId)51 ArrayList (java.util.ArrayList)15 Workbasket (pro.taskana.Workbasket)9 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)7 WorkbasketQuery (pro.taskana.WorkbasketQuery)5 Classification (pro.taskana.Classification)3 Task (pro.taskana.Task)3 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)3 WorkbasketNotFoundException (pro.taskana.exceptions.WorkbasketNotFoundException)3 Instant (java.time.Instant)2 Arrays (java.util.Arrays)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 PersistenceException (org.apache.ibatis.exceptions.PersistenceException)2 Ignore (org.junit.Ignore)2