use of org.camunda.bpm.engine.history.HistoricJobLogQuery in project camunda-bpm-platform by camunda.
the class ProcessEngineRestServiceTest method createHistoricJobLogMock.
private void createHistoricJobLogMock() {
HistoricJobLogQuery mockHistoricJobLogQuery = mock(HistoricJobLogQuery.class);
List<HistoricJobLog> historicJobLogs = MockProvider.createMockHistoricJobLogs();
when(mockHistoricJobLogQuery.list()).thenReturn(historicJobLogs);
when(mockHistoryService.createHistoricJobLogQuery()).thenReturn(mockHistoricJobLogQuery);
}
use of org.camunda.bpm.engine.history.HistoricJobLogQuery in project camunda-bpm-platform by camunda.
the class HistoricJobLogRestServiceImpl method queryHistoricJobLogsCount.
public CountResultDto queryHistoricJobLogsCount(HistoricJobLogQueryDto queryDto) {
queryDto.setObjectMapper(objectMapper);
HistoricJobLogQuery query = queryDto.toQuery(processEngine);
long count = query.count();
CountResultDto result = new CountResultDto();
result.setCount(count);
return result;
}
use of org.camunda.bpm.engine.history.HistoricJobLogQuery in project camunda-bpm-platform by camunda.
the class HistoricJobLogRestServiceInteractionTest method testHistoricJobLogGetIdDoesntExist.
@Test
public void testHistoricJobLogGetIdDoesntExist() {
String id = "nonExistingId";
HistoricJobLogQuery invalidQueryNonExistingHistoricJobLog = mock(HistoricJobLogQuery.class);
when(mockHistoryService.createHistoricJobLogQuery().logId(id)).thenReturn(invalidQueryNonExistingHistoricJobLog);
when(invalidQueryNonExistingHistoricJobLog.singleResult()).thenReturn(null);
given().pathParam("id", id).then().expect().statusCode(Status.NOT_FOUND.getStatusCode()).contentType(ContentType.JSON).body("type", equalTo(InvalidRequestException.class.getSimpleName())).body("message", equalTo("Historic job log with id " + id + " does not exist")).when().get(SINGLE_HISTORIC_JOB_LOG_RESOURCE_URL);
}
use of org.camunda.bpm.engine.history.HistoricJobLogQuery in project camunda-bpm-platform by camunda.
the class HistoricJobLogRestServiceQueryTest method setUpMockHistoricJobLogQuery.
protected HistoricJobLogQuery setUpMockHistoricJobLogQuery(List<HistoricJobLog> mockedHistoricJogLogs) {
HistoricJobLogQuery mockedhistoricJobLogQuery = mock(HistoricJobLogQuery.class);
when(mockedhistoricJobLogQuery.list()).thenReturn(mockedHistoricJogLogs);
when(mockedhistoricJobLogQuery.count()).thenReturn((long) mockedHistoricJogLogs.size());
when(processEngine.getHistoryService().createHistoricJobLogQuery()).thenReturn(mockedhistoricJobLogQuery);
return mockedhistoricJobLogQuery;
}
use of org.camunda.bpm.engine.history.HistoricJobLogQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricJobLogQueryTest method testQueryByNonExistingTenantId.
public void testQueryByNonExistingTenantId() {
HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().tenantIdIn("nonExisting");
assertThat(query.count(), is(0L));
}
Aggregations