use of org.camunda.bpm.engine.history.HistoricProcessInstanceReport in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceRestServiceReportTest method setUpMockHistoricProcessInstanceReportQuery.
private HistoricProcessInstanceReport setUpMockHistoricProcessInstanceReportQuery() {
HistoricProcessInstanceReport mockedReportQuery = mock(HistoricProcessInstanceReport.class);
when(mockedReportQuery.processDefinitionIdIn(anyString())).thenReturn(mockedReportQuery);
when(mockedReportQuery.processDefinitionKeyIn(anyString())).thenReturn(mockedReportQuery);
when(mockedReportQuery.startedAfter(any(Date.class))).thenReturn(mockedReportQuery);
when(mockedReportQuery.startedBefore(any(Date.class))).thenReturn(mockedReportQuery);
List<DurationReportResult> durationReportByMonth = createMockHistoricProcessInstanceDurationReportByMonth();
when(mockedReportQuery.duration(MONTH)).thenReturn(durationReportByMonth);
List<DurationReportResult> durationReportByQuarter = createMockHistoricProcessInstanceDurationReportByQuarter();
when(mockedReportQuery.duration(QUARTER)).thenReturn(durationReportByQuarter);
when(mockedReportQuery.duration(null)).thenThrow(new NotValidException("periodUnit is null"));
when(processEngine.getHistoryService().createHistoricProcessInstanceReport()).thenReturn(mockedReportQuery);
return mockedReportQuery;
}
use of org.camunda.bpm.engine.history.HistoricProcessInstanceReport in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceDurationReportTest method testReportByInvalidStartedBefore.
public void testReportByInvalidStartedBefore() {
HistoricProcessInstanceReport report = historyService.createHistoricProcessInstanceReport();
try {
report.startedBefore(null);
fail();
} catch (NotValidException e) {
}
}
use of org.camunda.bpm.engine.history.HistoricProcessInstanceReport in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceDurationReportTest method testReportByInvalidStartedAfter.
public void testReportByInvalidStartedAfter() {
HistoricProcessInstanceReport report = historyService.createHistoricProcessInstanceReport();
try {
report.startedAfter(null);
fail();
} catch (NotValidException e) {
}
}
use of org.camunda.bpm.engine.history.HistoricProcessInstanceReport in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceDurationReportTest method testReportByInvalidPeriodUnit.
public void testReportByInvalidPeriodUnit() {
HistoricProcessInstanceReport report = historyService.createHistoricProcessInstanceReport();
try {
report.duration(null);
fail();
} catch (NotValidException e) {
}
}
Aggregations