use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class TaskQueryTest method testExtendingTaskQueryList_TaskDefinitionKeyIn.
public void testExtendingTaskQueryList_TaskDefinitionKeyIn() {
// given
String taskDefinitionKey = "assigneApprover";
TaskQuery query = taskService.createTaskQuery();
TaskQuery extendingQuery = taskService.createTaskQuery().taskDefinitionKeyIn(taskDefinitionKey);
// when
TaskQuery result = ((TaskQueryImpl) query).extend(extendingQuery);
// then
String[] key = ((TaskQueryImpl) result).getKeys();
assertEquals(1, key.length);
assertEquals(taskDefinitionKey, key[0]);
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class TaskQueryTest method testExtendTaskQueryList_ProcessDefinitionKeyIn.
public void testExtendTaskQueryList_ProcessDefinitionKeyIn() {
// given
String processDefinitionKey = "invoice";
TaskQuery query = taskService.createTaskQuery().processDefinitionKeyIn(processDefinitionKey);
TaskQuery extendingQuery = taskService.createTaskQuery();
// when
TaskQuery result = ((TaskQueryImpl) query).extend(extendingQuery);
// then
String[] processDefinitionKeys = ((TaskQueryImpl) result).getProcessDefinitionKeys();
assertEquals(1, processDefinitionKeys.length);
assertEquals(processDefinitionKey, processDefinitionKeys[0]);
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class TaskQueryOrTest method shouldReturnTasksByExtendingQuery_OrInExtendingQuery.
@Test
public void shouldReturnTasksByExtendingQuery_OrInExtendingQuery() {
// given
TaskQuery extendedQuery = taskService.createTaskQuery().taskCandidateGroup("sales");
TaskQuery extendingQuery = taskService.createTaskQuery().or().taskName("aTaskName").endOr().or().taskNameLike("anotherTaskName").endOr();
// when
TaskQueryImpl result = (TaskQueryImpl) ((TaskQueryImpl) extendedQuery).extend(extendingQuery);
// then
assertEquals("sales", result.getCandidateGroup());
assertEquals("aTaskName", result.getQueries().get(1).getName());
assertEquals("anotherTaskName", result.getQueries().get(2).getNameLike());
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class TaskRestServiceQueryTest method testOrQuery.
@Test
public void testOrQuery() {
TaskQueryDto queryDto = TaskQueryDto.fromQuery(new TaskQueryImpl().or().taskName(MockProvider.EXAMPLE_TASK_NAME).taskDescription(MockProvider.EXAMPLE_TASK_DESCRIPTION).endOr());
given().contentType(POST_JSON_CONTENT_TYPE).header(ACCEPT_JSON_HEADER).body(queryDto).then().expect().statusCode(Status.OK.getStatusCode()).when().post(TASK_QUERY_URL);
ArgumentCaptor<TaskQueryImpl> argument = ArgumentCaptor.forClass(TaskQueryImpl.class);
verify(((TaskQueryImpl) mockQuery)).addOrQuery(argument.capture());
assertEquals(MockProvider.EXAMPLE_TASK_NAME, argument.getValue().getName());
assertEquals(MockProvider.EXAMPLE_TASK_DESCRIPTION, argument.getValue().getDescription());
}
use of org.camunda.bpm.engine.impl.TaskQueryImpl in project camunda-bpm-platform by camunda.
the class MultiTenancyFilterServiceTest method testCreateFilterWithTenantIdCriteria.
public void testCreateFilterWithTenantIdCriteria() {
TaskQuery query = taskService.createTaskQuery().tenantIdIn(TENANT_IDS);
filterId = createFilter(query);
Filter savedFilter = filterService.getFilter(filterId);
TaskQueryImpl savedQuery = savedFilter.getQuery();
assertThat(savedQuery.getTenantIds(), is(TENANT_IDS));
}
Aggregations