use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class ProcessEngineRestServiceTest method createHistoricIncidentMock.
private void createHistoricIncidentMock() {
HistoricIncidentQuery mockHistoricIncidentQuery = mock(HistoricIncidentQuery.class);
List<HistoricIncident> historicIncidents = MockProvider.createMockHistoricIncidents();
when(mockHistoricIncidentQuery.list()).thenReturn(historicIncidents);
when(mockHistoryService.createHistoricIncidentQuery()).thenReturn(mockHistoricIncidentQuery);
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class HistoricIncidentRestServiceQueryTest method setUpMockHistoricIncidentQuery.
private HistoricIncidentQuery setUpMockHistoricIncidentQuery(List<HistoricIncident> mockedHistoricIncidents) {
HistoricIncidentQuery mockedHistoricIncidentQuery = mock(HistoricIncidentQuery.class);
when(mockedHistoricIncidentQuery.list()).thenReturn(mockedHistoricIncidents);
when(mockedHistoricIncidentQuery.count()).thenReturn((long) mockedHistoricIncidents.size());
when(processEngine.getHistoryService().createHistoricIncidentQuery()).thenReturn(mockedHistoricIncidentQuery);
return mockedHistoricIncidentQuery;
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricIncidentQueryTest method testQueryByNonExistingTenantId.
public void testQueryByNonExistingTenantId() {
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery().tenantIdIn("nonExisting");
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricIncidentQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.history.HistoricIncidentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricIncidentQueryTest method testQueryAuthenticatedTenants.
public void testQueryAuthenticatedTenants() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
HistoricIncidentQuery query = historyService.createHistoricIncidentQuery();
assertThat(query.count(), is(2L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
Aggregations