示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testReportByInvalidProcessDefinitionId()
        public virtual void testReportByInvalidProcessDefinitionId()
        {
            CleanableHistoricProcessInstanceReport report = historyService.createCleanableHistoricProcessInstanceReport();

            try
            {
                report.processDefinitionIdIn(null);
                fail("Expected NotValidException");
            }
            catch (NotValidException)
            {
                // expected
            }

            try
            {
                report.processDefinitionIdIn("abc", null, "def");
                fail("Expected NotValidException");
            }
            catch (NotValidException)
            {
                // expected
            }
        }
示例#2
0
        private void setupHistoryReportMock()
        {
            CleanableHistoricProcessInstanceReport report = mock(typeof(CleanableHistoricProcessInstanceReport));

            when(report.processDefinitionIdIn(anyString())).thenReturn(report);
            when(report.processDefinitionKeyIn(anyString())).thenReturn(report);

            CleanableHistoricProcessInstanceReportResult reportResult = mock(typeof(CleanableHistoricProcessInstanceReportResult));

            when(reportResult.ProcessDefinitionId).thenReturn(EXAMPLE_PROCESS_DEFINITION_ID);
            when(reportResult.ProcessDefinitionKey).thenReturn(EXAMPLE_PD_KEY);
            when(reportResult.ProcessDefinitionName).thenReturn(EXAMPLE_PD_NAME);
            when(reportResult.ProcessDefinitionVersion).thenReturn(EXAMPLE_PD_VERSION);
            when(reportResult.HistoryTimeToLive).thenReturn(EXAMPLE_TTL);
            when(reportResult.FinishedProcessInstanceCount).thenReturn(EXAMPLE_FINISHED_PI_COUNT);
            when(reportResult.CleanableProcessInstanceCount).thenReturn(EXAMPLE_CLEANABLE_PI_COUNT);
            when(reportResult.TenantId).thenReturn(EXAMPLE_TENANT_ID);

            CleanableHistoricProcessInstanceReportResult anotherReportResult = mock(typeof(CleanableHistoricProcessInstanceReportResult));

            when(anotherReportResult.ProcessDefinitionId).thenReturn(ANOTHER_EXAMPLE_PROCESS_DEFINITION_ID);
            when(anotherReportResult.ProcessDefinitionKey).thenReturn(ANOTHER_EXAMPLE_PD_KEY);
            when(anotherReportResult.ProcessDefinitionName).thenReturn("pdName");
            when(anotherReportResult.ProcessDefinitionVersion).thenReturn(33);
            when(anotherReportResult.HistoryTimeToLive).thenReturn(null);
            when(anotherReportResult.FinishedProcessInstanceCount).thenReturn(13l);
            when(anotherReportResult.CleanableProcessInstanceCount).thenReturn(0l);
            when(anotherReportResult.TenantId).thenReturn(ANOTHER_EXAMPLE_TENANT_ID);

            IList <CleanableHistoricProcessInstanceReportResult> mocks = new List <CleanableHistoricProcessInstanceReportResult>();

            mocks.Add(reportResult);
            mocks.Add(anotherReportResult);

            when(report.list()).thenReturn(mocks);
            when(report.count()).thenReturn((long)mocks.Count);

            historicProcessInstanceReport = report;
            when(processEngine.HistoryService.createCleanableHistoricProcessInstanceReport()).thenReturn(historicProcessInstanceReport);
        }