use of org.camunda.bpm.engine.runtime.EventSubscriptionQuery in project camunda-bpm-platform by camunda.
the class EventSubscriptionAuthorizationTest method testQueryWithReadInstancesPermissionOnOneTaskProcess.
public void testQueryWithReadInstancesPermissionOnOneTaskProcess() {
// given
startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
startProcessInstanceByKey(ONE_TASK_PROCESS_KEY);
startProcessInstanceByKey(SIGNAL_BOUNDARY_PROCESS_KEY);
startProcessInstanceByKey(SIGNAL_BOUNDARY_PROCESS_KEY);
startProcessInstanceByKey(SIGNAL_BOUNDARY_PROCESS_KEY);
startProcessInstanceByKey(SIGNAL_BOUNDARY_PROCESS_KEY);
createGrantAuthorization(PROCESS_DEFINITION, ONE_TASK_PROCESS_KEY, userId, READ_INSTANCE);
// when
EventSubscriptionQuery query = runtimeService.createEventSubscriptionQuery();
// then
verifyQueryResults(query, 3);
}
use of org.camunda.bpm.engine.runtime.EventSubscriptionQuery in project camunda-bpm-platform by camunda.
the class EventSubscriptionAuthorizationTest method testSimpleQueryWithReadInstancesPermissionOnAnyProcessDefinition.
public void testSimpleQueryWithReadInstancesPermissionOnAnyProcessDefinition() {
// given
String processInstanceId = startProcessInstanceByKey(ONE_TASK_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_INSTANCE);
// when
EventSubscriptionQuery query = runtimeService.createEventSubscriptionQuery();
// then
verifyQueryResults(query, 1);
EventSubscription eventSubscription = query.singleResult();
assertNotNull(eventSubscription);
assertEquals(processInstanceId, eventSubscription.getProcessInstanceId());
}
Aggregations