Search in sources :

Example 31 with IncidentQuery

use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.

the class ProcessEngineRestServiceTest method createIncidentMock.

private void createIncidentMock() {
    IncidentQuery mockIncidentQuery = mock(IncidentQuery.class);
    List<Incident> incidents = MockProvider.createMockIncidents();
    when(mockIncidentQuery.list()).thenReturn(incidents);
    when(mockRuntimeService.createIncidentQuery()).thenReturn(mockIncidentQuery);
}
Also used : HistoricIncidentQuery(org.camunda.bpm.engine.history.HistoricIncidentQuery) IncidentQuery(org.camunda.bpm.engine.runtime.IncidentQuery) HistoricIncident(org.camunda.bpm.engine.history.HistoricIncident) Incident(org.camunda.bpm.engine.runtime.Incident)

Example 32 with IncidentQuery

use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyIncidentQueryTest method testQueryAuthenticatedTenant.

public void testQueryAuthenticatedTenant() {
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
    IncidentQuery query = runtimeService.createIncidentQuery();
    assertThat(query.count(), is(1L));
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
    assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
    assertThat(query.tenantIdIn(TENANT_ONE, TENANT_TWO).count(), is(1L));
}
Also used : IncidentQuery(org.camunda.bpm.engine.runtime.IncidentQuery)

Example 33 with IncidentQuery

use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyIncidentQueryTest method testQueryWithoutTenantId.

public void testQueryWithoutTenantId() {
    IncidentQuery query = runtimeService.createIncidentQuery();
    assertThat(query.count(), is(2L));
}
Also used : IncidentQuery(org.camunda.bpm.engine.runtime.IncidentQuery)

Example 34 with IncidentQuery

use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyIncidentQueryTest method testQueryByTenantIds.

public void testQueryByTenantIds() {
    IncidentQuery query = runtimeService.createIncidentQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
    assertThat(query.count(), is(2L));
}
Also used : IncidentQuery(org.camunda.bpm.engine.runtime.IncidentQuery)

Example 35 with IncidentQuery

use of org.camunda.bpm.engine.runtime.IncidentQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyIncidentQueryTest method testQueryByTenantId.

public void testQueryByTenantId() {
    IncidentQuery query = runtimeService.createIncidentQuery().tenantIdIn(TENANT_ONE);
    assertThat(query.count(), is(1L));
    query = runtimeService.createIncidentQuery().tenantIdIn(TENANT_TWO);
    assertThat(query.count(), is(1L));
}
Also used : IncidentQuery(org.camunda.bpm.engine.runtime.IncidentQuery)

Aggregations

IncidentQuery (org.camunda.bpm.engine.runtime.IncidentQuery)55 Incident (org.camunda.bpm.engine.runtime.Incident)34 Test (org.junit.Test)21 HistoricIncident (org.camunda.bpm.engine.history.HistoricIncident)7 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)3 Deployment (org.camunda.bpm.engine.test.Deployment)3 IncidentQueryDto (org.camunda.bpm.engine.rest.dto.runtime.IncidentQueryDto)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1 HistoricIncidentQuery (org.camunda.bpm.engine.history.HistoricIncidentQuery)1 RuntimeServiceImpl (org.camunda.bpm.engine.impl.RuntimeServiceImpl)1 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 IncidentDto (org.camunda.bpm.engine.rest.dto.runtime.IncidentDto)1 Execution (org.camunda.bpm.engine.runtime.Execution)1 Job (org.camunda.bpm.engine.runtime.Job)1