use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testEmptyQuery.
public void testEmptyQuery() {
TaskQuery emptyQuery = taskService.createTaskQuery();
String emptyQueryJson = "{}";
filter.setQuery(emptyQuery);
assertEquals(emptyQueryJson, ((FilterEntity) filter).getQueryInternal());
assertNotNull(filter.getQuery());
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testExecuteTaskQueryList.
public void testExecuteTaskQueryList() {
TaskQuery query = taskService.createTaskQuery();
query.taskNameLike("Task%");
saveQuery(query);
List<Task> tasks = filterService.list(filter.getId());
assertEquals(3, tasks.size());
for (Task task : tasks) {
assertEquals(testUser.getId(), task.getOwner());
}
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testExtendingTaskQueryListWithIncludeAssignedTasks.
public void testExtendingTaskQueryListWithIncludeAssignedTasks() {
TaskQuery query = taskService.createTaskQuery();
query.taskCandidateGroup("accounting");
saveQuery(query);
List<Task> tasks = filterService.list(filter.getId());
assertEquals(1, tasks.size());
TaskQuery extendingQuery = taskService.createTaskQuery();
extendingQuery.taskCandidateGroup("accounting").includeAssignedTasks();
tasks = filterService.list(filter.getId(), extendingQuery);
assertEquals(2, tasks.size());
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class FilterTaskQueryTest method testExtendingTaskQueryListWithCandidateGroups.
public void testExtendingTaskQueryListWithCandidateGroups() {
TaskQuery query = taskService.createTaskQuery();
List<String> candidateGroups = new ArrayList<String>();
candidateGroups.add("accounting");
query.taskCandidateGroupIn(candidateGroups);
saveQuery(query);
List<Task> tasks = filterService.list(filter.getId());
assertEquals(1, tasks.size());
tasks = filterService.list(filter.getId(), query);
assertEquals(1, tasks.size());
TaskQuery extendingQuery = taskService.createTaskQuery();
extendingQuery.orderByTaskCreateTime().asc();
tasks = filterService.list(filter.getId(), extendingQuery);
assertEquals(1, tasks.size());
}
use of org.camunda.bpm.engine.task.TaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyFilterServiceTest method testFilterTasksByTenantIdNoAuthenticatedTenants.
public void testFilterTasksByTenantIdNoAuthenticatedTenants() {
TaskQuery query = taskService.createTaskQuery().tenantIdIn(TENANT_ONE);
filterId = createFilter(query);
identityService.setAuthentication("user", null, null);
assertThat(filterService.count(filterId), is(0L));
}
Aggregations