Search in sources :

Example 1 with HistoricIncidentQuery

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);
}
Also used : HistoricIncident(org.camunda.bpm.engine.history.HistoricIncident) HistoricIncidentQuery(org.camunda.bpm.engine.history.HistoricIncidentQuery)

Example 2 with HistoricIncidentQuery

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;
}
Also used : HistoricIncidentQuery(org.camunda.bpm.engine.history.HistoricIncidentQuery)

Example 3 with HistoricIncidentQuery

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));
}
Also used : HistoricIncidentQuery(org.camunda.bpm.engine.history.HistoricIncidentQuery)

Example 4 with HistoricIncidentQuery

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));
}
Also used : HistoricIncidentQuery(org.camunda.bpm.engine.history.HistoricIncidentQuery)

Example 5 with HistoricIncidentQuery

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));
}
Also used : HistoricIncidentQuery(org.camunda.bpm.engine.history.HistoricIncidentQuery)

Aggregations

HistoricIncidentQuery (org.camunda.bpm.engine.history.HistoricIncidentQuery)61 Test (org.junit.Test)29 Deployment (org.camunda.bpm.engine.test.Deployment)20 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)13 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)7 HistoricIncident (org.camunda.bpm.engine.history.HistoricIncident)6 Date (java.util.Date)4 Job (org.camunda.bpm.engine.runtime.Job)4 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)2 HistoricIncidentQueryDto (org.camunda.bpm.engine.rest.dto.history.HistoricIncidentQueryDto)2 Incident (org.camunda.bpm.engine.runtime.Incident)2 ArrayList (java.util.ArrayList)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 HistoricIncidentDto (org.camunda.bpm.engine.rest.dto.history.HistoricIncidentDto)1