use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentAuthorizationTest method testSimpleQueryWithReadPermissionOnProcessInstance.
public void testSimpleQueryWithReadPermissionOnProcessInstance() {
// given
String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_INSTANCE, processInstanceId, userId, READ);
// when
IncidentQuery query = runtimeService.createIncidentQuery();
// then
verifyQueryResults(query, 1);
Incident incident = query.singleResult();
assertNotNull(incident);
assertEquals(processInstanceId, incident.getProcessInstanceId());
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentAuthorizationTest method testSimpleQueryWithReadInstancesPermissionOnOneTaskProcess.
public void testSimpleQueryWithReadInstancesPermissionOnOneTaskProcess() {
// given
String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_DEFINITION, ONE_INCIDENT_PROCESS_KEY, userId, READ_INSTANCE);
// when
IncidentQuery query = runtimeService.createIncidentQuery();
// then
verifyQueryResults(query, 1);
Incident incident = query.singleResult();
assertNotNull(incident);
assertEquals(processInstanceId, incident.getProcessInstanceId());
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentAuthorizationTest method testStartTimerJobIncidentQueryWithReadPermissionOnAnyProcessInstance.
public void testStartTimerJobIncidentQueryWithReadPermissionOnAnyProcessInstance() {
// given
disableAuthorization();
String jobId = managementService.createJobQuery().singleResult().getId();
managementService.setJobRetries(jobId, 0);
enableAuthorization();
createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, READ);
// when
IncidentQuery query = runtimeService.createIncidentQuery();
// then
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentAuthorizationTest method testStartTimerJobIncidentQueryWithReadInstancePermissionOnAnyProcessDefinition.
public void testStartTimerJobIncidentQueryWithReadInstancePermissionOnAnyProcessDefinition() {
// given
disableAuthorization();
String jobId = managementService.createJobQuery().singleResult().getId();
managementService.setJobRetries(jobId, 0);
enableAuthorization();
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_INSTANCE);
// when
IncidentQuery query = runtimeService.createIncidentQuery();
// then
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentAuthorizationTest method testSimpleQueryWithReadInstancesPermissionOnAnyProcessDefinition.
public void testSimpleQueryWithReadInstancesPermissionOnAnyProcessDefinition() {
// given
String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_INSTANCE);
// when
IncidentQuery query = runtimeService.createIncidentQuery();
// then
verifyQueryResults(query, 1);
Incident incident = query.singleResult();
assertNotNull(incident);
assertEquals(processInstanceId, incident.getProcessInstanceId());
}
Aggregations