use of org.camunda.bpm.engine.runtime.ExecutionQuery in project camunda-bpm-platform by camunda.
the class ExecutionAuthorizationTest method testQueryWithReadPermissionOnAnyProcessInstance.
public void testQueryWithReadPermissionOnAnyProcessInstance() {
// given
startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, READ);
// when
ExecutionQuery query = runtimeService.createExecutionQuery();
// then
verifyQueryResults(query, 11);
}
use of org.camunda.bpm.engine.runtime.ExecutionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyExecutionQueryTest method testQueryDisabledTenantCheck.
public void testQueryDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
ExecutionQuery query = runtimeService.createExecutionQuery();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.runtime.ExecutionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyExecutionQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
ExecutionQuery query = runtimeService.createExecutionQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.runtime.ExecutionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyExecutionQueryTest method testQueryNoAuthenticatedTenants.
public void testQueryNoAuthenticatedTenants() {
identityService.setAuthentication("user", null, null);
ExecutionQuery query = runtimeService.createExecutionQuery();
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.ExecutionQuery in project camunda-bpm-platform by camunda.
the class ExecutionQueryTest method testQueryByActivityId.
public void testQueryByActivityId() {
ExecutionQuery query = runtimeService.createExecutionQuery().activityId("receivePayment");
assertEquals(4, query.list().size());
assertEquals(4, query.count());
try {
assertNull(query.singleResult());
fail();
} catch (ProcessEngineException e) {
}
}
Aggregations