use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyIncidentQueryTest method testQueryByNonExistingTenantId.
public void testQueryByNonExistingTenantId() {
IncidentQuery query = runtimeService.createIncidentQuery().tenantIdIn("nonExisting");
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyIncidentQueryTest method testQueryNoAuthenticatedTenants.
public void testQueryNoAuthenticatedTenants() {
identityService.setAuthentication("user", null, null);
IncidentQuery query = runtimeService.createIncidentQuery();
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyIncidentQueryTest method testQueryDisabledTenantCheck.
public void testQueryDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
IncidentQuery query = runtimeService.createIncidentQuery();
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyIncidentQueryTest method testQueryAuthenticatedTenants.
public void testQueryAuthenticatedTenants() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
IncidentQuery query = runtimeService.createIncidentQuery();
assertThat(query.count(), is(2L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.
the class IncidentTest method testDoNotCreateNewIncident.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/mgmt/IncidentTest.testShouldCreateOneIncident.bpmn" })
public void testDoNotCreateNewIncident() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("failingProcess");
executeAvailableJobs();
IncidentQuery query = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId());
Incident incident = query.singleResult();
assertNotNull(incident);
JobDefinition jobDefinition = managementService.createJobDefinitionQuery().singleResult();
// set retries to 1 by job definition id
managementService.setJobRetriesByJobDefinitionId(jobDefinition.getId(), 1);
// the incident still exists
Incident tmp = query.singleResult();
assertEquals(incident.getId(), tmp.getId());
// execute the available job (should fail again)
executeAvailableJobs();
// the incident still exists and there
// should be not a new incident
assertEquals(1, query.count());
tmp = query.singleResult();
assertEquals(incident.getId(), tmp.getId());
}
Aggregations