use of org.camunda.bpm.engine.runtime.ExecutionQuery in project camunda-bpm-platform by camunda.
the class ExecutionAuthorizationTest method testSimpleQueryWithReadInstancesPermissionOnAnyProcessDefinition.
public void testSimpleQueryWithReadInstancesPermissionOnAnyProcessDefinition() {
// given
String processInstanceId = startProcessInstanceByKey(ONE_TASK_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_INSTANCE);
// when
ExecutionQuery query = runtimeService.createExecutionQuery();
// then
verifyQueryResults(query, 1);
Execution execution = query.singleResult();
assertNotNull(execution);
assertEquals(processInstanceId, execution.getProcessInstanceId());
}
use of org.camunda.bpm.engine.runtime.ExecutionQuery in project camunda-bpm-platform by camunda.
the class ExecutionAuthorizationTest method testSimpleQueryWithReadInstancesPermissionOnOneTaskProcess.
public void testSimpleQueryWithReadInstancesPermissionOnOneTaskProcess() {
// given
String processInstanceId = startProcessInstanceByKey(ONE_TASK_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_DEFINITION, ONE_TASK_PROCESS_KEY, userId, READ_INSTANCE);
// when
ExecutionQuery query = runtimeService.createExecutionQuery();
// then
verifyQueryResults(query, 1);
Execution execution = query.singleResult();
assertNotNull(execution);
assertEquals(processInstanceId, execution.getProcessInstanceId());
}
use of org.camunda.bpm.engine.runtime.ExecutionQuery in project camunda-bpm-platform by camunda.
the class ExecutionAuthorizationTest method testQueryWithReadPermissionOnProcessInstance.
public void testQueryWithReadPermissionOnProcessInstance() {
// given
startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
String processInstanceId = startProcessInstanceByKey(ONE_TASK_PROCESS_KEY).getId();
startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_BOUNDARY_PROCESS_KEY);
createGrantAuthorization(PROCESS_INSTANCE, processInstanceId, userId, READ);
// when
ExecutionQuery query = runtimeService.createExecutionQuery();
// then
verifyQueryResults(query, 1);
Execution execution = query.singleResult();
assertNotNull(execution);
assertEquals(processInstanceId, execution.getProcessInstanceId());
}
use of org.camunda.bpm.engine.runtime.ExecutionQuery in project camunda-bpm-platform by camunda.
the class ExecutionAuthorizationTest method testQueryWithReadInstancesPermissionOnAnyProcessDefinition.
public void testQueryWithReadInstancesPermissionOnAnyProcessDefinition() {
// 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_DEFINITION, ANY, userId, READ_INSTANCE);
// 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 ExecutionAuthorizationTest method testQueryWithoutAuthorization.
public void testQueryWithoutAuthorization() {
// 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);
// when
ExecutionQuery query = runtimeService.createExecutionQuery();
// then
verifyQueryResults(query, 0);
}
Aggregations