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);
}
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));
}
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));
}
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));
}
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));
}
Aggregations