use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentAuthorizationTest method testStartTimerJobIncidentQueryWithReadInstancePermissionOnProcessDefinition.
public void testStartTimerJobIncidentQueryWithReadInstancePermissionOnProcessDefinition() {
// given
disableAuthorization();
String jobId = managementService.createJobQuery().singleResult().getId();
managementService.setJobRetries(jobId, 0);
enableAuthorization();
createGrantAuthorization(PROCESS_DEFINITION, TIMER_START_PROCESS_KEY, 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 testQueryWithReadPermissionOnProcessInstance.
public void testQueryWithReadPermissionOnProcessInstance() {
// given
startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY).getId();
startProcessAndExecuteJob(ANOTHER_ONE_INCIDENT_PROCESS_KEY);
startProcessAndExecuteJob(ANOTHER_ONE_INCIDENT_PROCESS_KEY);
startProcessAndExecuteJob(ANOTHER_ONE_INCIDENT_PROCESS_KEY);
startProcessAndExecuteJob(ANOTHER_ONE_INCIDENT_PROCESS_KEY);
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 testStartTimerJobIncidentQueryWithoutAuthorization.
public void testStartTimerJobIncidentQueryWithoutAuthorization() {
// given
disableAuthorization();
String jobId = managementService.createJobQuery().singleResult().getId();
managementService.setJobRetries(jobId, 0);
enableAuthorization();
// when
IncidentQuery query = runtimeService.createIncidentQuery();
// then
verifyQueryResults(query, 0);
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentAuthorizationTest method testSimpleQueryWithoutAuthorization.
public void testSimpleQueryWithoutAuthorization() {
// given
startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
// when
IncidentQuery query = runtimeService.createIncidentQuery();
// then
verifyQueryResults(query, 0);
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentAuthorizationTest method testSimpleQueryWithMultiple.
public void testSimpleQueryWithMultiple() {
// given
String processInstanceId = startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_INSTANCE, processInstanceId, userId, READ);
createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, READ);
// when
IncidentQuery query = runtimeService.createIncidentQuery();
// then
verifyQueryResults(query, 1);
Incident incident = query.singleResult();
assertNotNull(incident);
assertEquals(processInstanceId, incident.getProcessInstanceId());
}
Aggregations