public virtual void testReportByInvalidStartedAfter() { HistoricProcessInstanceReport report = historyService.createHistoricProcessInstanceReport(); try { report.startedAfter(null); fail(); } catch (NotValidException) { } }
private HistoricProcessInstanceReport setUpMockHistoricProcessInstanceReportQuery() { HistoricProcessInstanceReport mockedReportQuery = mock(typeof(HistoricProcessInstanceReport)); when(mockedReportQuery.processDefinitionIdIn(anyString())).thenReturn(mockedReportQuery); when(mockedReportQuery.processDefinitionKeyIn(anyString())).thenReturn(mockedReportQuery); when(mockedReportQuery.startedAfter(any(typeof(DateTime)))).thenReturn(mockedReportQuery); when(mockedReportQuery.startedBefore(any(typeof(DateTime)))).thenReturn(mockedReportQuery); IList <DurationReportResult> durationReportByMonth = createMockHistoricProcessInstanceDurationReportByMonth(); when(mockedReportQuery.duration(MONTH)).thenReturn(durationReportByMonth); IList <DurationReportResult> durationReportByQuarter = createMockHistoricProcessInstanceDurationReportByQuarter(); when(mockedReportQuery.duration(QUARTER)).thenReturn(durationReportByQuarter); when(mockedReportQuery.duration(null)).thenThrow(new NotValidException("periodUnit is null")); when(processEngine.HistoryService.createHistoricProcessInstanceReport()).thenReturn(mockedReportQuery); return(mockedReportQuery); }