Search in sources :

Example 1 with HistoricProcessInstanceReport

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;
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) HistoricProcessInstanceReport(org.camunda.bpm.engine.history.HistoricProcessInstanceReport) DurationReportResult(org.camunda.bpm.engine.history.DurationReportResult) Date(java.util.Date)

Example 2 with HistoricProcessInstanceReport

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) {
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) HistoricProcessInstanceReport(org.camunda.bpm.engine.history.HistoricProcessInstanceReport)

Example 3 with HistoricProcessInstanceReport

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) {
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) HistoricProcessInstanceReport(org.camunda.bpm.engine.history.HistoricProcessInstanceReport)

Example 4 with HistoricProcessInstanceReport

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) {
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) HistoricProcessInstanceReport(org.camunda.bpm.engine.history.HistoricProcessInstanceReport)

Aggregations

NotValidException (org.camunda.bpm.engine.exception.NotValidException)4 HistoricProcessInstanceReport (org.camunda.bpm.engine.history.HistoricProcessInstanceReport)4 Date (java.util.Date)1 DurationReportResult (org.camunda.bpm.engine.history.DurationReportResult)1