public virtual void testReportByInvalidProcessDefinitionKey() { HistoricProcessInstanceReport report = historyService.createHistoricProcessInstanceReport(); try { report.processDefinitionKeyIn((string)null); } catch (NotValidException) { } try { report.processDefinitionKeyIn("abc", (string)null, "def"); } 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); }