use of pro.taskana.TaskSummary in project taskana by Taskana.
the class TaskServiceImplIntAutocommitTest method should_ReturnList_when_BuilderIsUsed.
@Test
public void should_ReturnList_when_BuilderIsUsed() throws SQLException, NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException, TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException, SystemException, WorkbasketAlreadyExistException, DomainNotFoundException {
Workbasket wb = workbasketService.newWorkbasket("key", "DOMAIN_A");
wb.setName("workbasket");
wb.setType(WorkbasketType.GROUP);
taskanaEngine.getWorkbasketService().createWorkbasket(wb);
Classification classification = classificationService.newClassification("TEST", "DOMAIN_A", "TASK");
taskanaEngine.getClassificationService().createClassification(classification);
Task task = taskServiceImpl.newTask(wb.getKey(), wb.getDomain());
task.setName("Unit Test Task");
task.setClassificationKey(classification.getKey());
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
taskServiceImpl.createTask(task);
List<TaskSummary> results = taskServiceImpl.createTaskQuery().nameIn("bla", "test").descriptionLike("test").priorityIn(1, 2, 2).stateIn(TaskState.CLAIMED).workbasketKeyDomainIn(new KeyDomain("asd", "novatec"), new KeyDomain("asdasdasd", "DOMAIN_A")).ownerIn("test", "test2", "bla").customAttributeIn("16", "test").classificationKeyIn("pId1", "pId2").primaryObjectReferenceCompanyIn("first comp", "sonstwo gmbh").primaryObjectReferenceSystemIn("sys").primaryObjectReferenceTypeIn("type1", "type2").primaryObjectReferenceSystemInstanceIn("sysInst1", "sysInst2").primaryObjectReferenceValueIn("val1", "val2", "val3").list();
Assert.assertEquals(0, results.size());
}
use of pro.taskana.TaskSummary in project taskana by Taskana.
the class TaskQueryAccTest method testTaskQueryUser_1_1BusinessAdm.
@WithAccessId(userName = "user_1_1", groupNames = { "businessadmin" })
@Test
public void testTaskQueryUser_1_1BusinessAdm() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().ownerLike("%a%", "%u%").list();
assertThat(results.size(), equalTo(3));
}
use of pro.taskana.TaskSummary in project taskana by Taskana.
the class TaskQueryAccTest method testTaskQueryUser_1_1.
@WithAccessId(// , groupNames = {"businessadmin"})
userName = "user_1_1")
@Test
public void testTaskQueryUser_1_1() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().ownerLike("%a%", "%u%").list();
assertThat(results.size(), equalTo(3));
}
use of pro.taskana.TaskSummary in project taskana by Taskana.
the class TaskQueryAccTest method testTaskQueryUser_1_1Admin.
@WithAccessId(userName = "user_1_1", groupNames = { "admin" })
@Test
public void testTaskQueryUser_1_1Admin() {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().ownerLike("%a%", "%u%").list();
assertThat(results.size(), equalTo(25));
}
use of pro.taskana.TaskSummary in project taskana by Taskana.
the class QueryTasksAccTest method testQueryForClassificationKey.
@WithAccessId(userName = "teamlead_1", groupNames = { "group_1", "group_2" })
@Test
public void testQueryForClassificationKey() throws SQLException, NotAuthorizedException, InvalidArgumentException {
TaskService taskService = taskanaEngine.getTaskService();
List<TaskSummary> results = taskService.createTaskQuery().classificationKeyLike("L10%").list();
assertThat(results.size(), equalTo(65));
String[] ids = results.stream().map(t -> t.getClassificationSummary().getKey()).collect(Collectors.toList()).toArray(new String[0]);
List<TaskSummary> result2 = taskService.createTaskQuery().classificationKeyIn(ids).list();
assertThat(result2.size(), equalTo(65));
}
Aggregations