use of org.camunda.bpm.engine.runtime.Incident in project camunda-bpm-platform by camunda.
the class IncidentQueryTest method testQueryByInvalidCauseIncidentId.
@Test
public void testQueryByInvalidCauseIncidentId() {
IncidentQuery query = runtimeService.createIncidentQuery().causeIncidentId("invalid");
assertEquals(0, query.count());
List<Incident> incidents = query.list();
assertTrue(incidents.isEmpty());
assertEquals(0, incidents.size());
}
use of org.camunda.bpm.engine.runtime.Incident in project camunda-bpm-platform by camunda.
the class IncidentQueryTest method testQueryByInvalidConfiguration.
@Test
public void testQueryByInvalidConfiguration() {
IncidentQuery query = runtimeService.createIncidentQuery().configuration("invalid");
assertEquals(0, query.count());
List<Incident> incidents = query.list();
assertTrue(incidents.isEmpty());
Incident incident = query.singleResult();
assertNull(incident);
}
use of org.camunda.bpm.engine.runtime.Incident in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByIncidentMessage.
@org.camunda.bpm.engine.test.Deployment(resources = { "org/camunda/bpm/engine/test/api/repository/failingProcessCreateOneIncident.bpmn20.xml" })
public void testQueryByIncidentMessage() {
assertEquals(1, repositoryService.createProcessDefinitionQuery().processDefinitionKey("failingProcess").count());
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("failingProcess");
executeAvailableJobs();
List<Incident> incidentList = runtimeService.createIncidentQuery().list();
assertEquals(1, incidentList.size());
Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId()).singleResult();
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().incidentMessage(incident.getIncidentMessage());
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.Incident in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByIncidentMessageLike.
@org.camunda.bpm.engine.test.Deployment(resources = { "org/camunda/bpm/engine/test/api/repository/failingProcessCreateOneIncident.bpmn20.xml" })
public void testQueryByIncidentMessageLike() {
assertEquals(1, repositoryService.createProcessDefinitionQuery().processDefinitionKey("failingProcess").count());
runtimeService.startProcessInstanceByKey("failingProcess");
executeAvailableJobs();
List<Incident> incidentList = runtimeService.createIncidentQuery().list();
assertEquals(1, incidentList.size());
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().incidentMessageLike("%expected%");
verifyQueryResults(query, 1);
query = repositoryService.createProcessDefinitionQuery().incidentMessageLike("%\\_expected%");
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.Incident in project camunda-bpm-platform by camunda.
the class ProcessDefinitionQueryTest method testQueryByIncidentId.
@org.camunda.bpm.engine.test.Deployment(resources = { "org/camunda/bpm/engine/test/api/repository/failingProcessCreateOneIncident.bpmn20.xml" })
public void testQueryByIncidentId() {
assertEquals(1, repositoryService.createProcessDefinitionQuery().processDefinitionKey("failingProcess").count());
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("failingProcess");
executeAvailableJobs();
List<Incident> incidentList = runtimeService.createIncidentQuery().list();
assertEquals(1, incidentList.size());
Incident incident = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId()).singleResult();
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().incidentId(incident.getId());
verifyQueryResults(query, 1);
}
Aggregations