Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testReportByInvalidCaseDefinitionId()
        public virtual void testReportByInvalidCaseDefinitionId()
        {
            CleanableHistoricCaseInstanceReport report = historyService.createCleanableHistoricCaseInstanceReport();

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

            try
            {
                report.caseDefinitionIdIn("abc", null, "def");
                fail("Expected NotValidException");
            }
            catch (NotValidException)
            {
                // expected
            }
        }
Пример #2
0
        private void setupHistoryReportMock()
        {
            CleanableHistoricCaseInstanceReport report = mock(typeof(CleanableHistoricCaseInstanceReport));

            when(report.caseDefinitionIdIn(anyString())).thenReturn(report);
            when(report.caseDefinitionKeyIn(anyString())).thenReturn(report);

            CleanableHistoricCaseInstanceReportResult reportResult = mock(typeof(CleanableHistoricCaseInstanceReportResult));

            when(reportResult.CaseDefinitionId).thenReturn(EXAMPLE_CD_ID);
            when(reportResult.CaseDefinitionKey).thenReturn(EXAMPLE_CD_KEY);
            when(reportResult.CaseDefinitionName).thenReturn(EXAMPLE_CD_NAME);
            when(reportResult.CaseDefinitionVersion).thenReturn(EXAMPLE_CD_VERSION);
            when(reportResult.HistoryTimeToLive).thenReturn(EXAMPLE_TTL);
            when(reportResult.FinishedCaseInstanceCount).thenReturn(EXAMPLE_FINISHED_CI_COUNT);
            when(reportResult.CleanableCaseInstanceCount).thenReturn(EXAMPLE_CLEANABLE_CI_COUNT);
            when(reportResult.TenantId).thenReturn(EXAMPLE_TENANT_ID);

            CleanableHistoricCaseInstanceReportResult anotherReportResult = mock(typeof(CleanableHistoricCaseInstanceReportResult));

            when(anotherReportResult.CaseDefinitionId).thenReturn(ANOTHER_EXAMPLE_CD_ID);
            when(anotherReportResult.CaseDefinitionKey).thenReturn(ANOTHER_EXAMPLE_CD_KEY);
            when(anotherReportResult.CaseDefinitionName).thenReturn("cdName");
            when(anotherReportResult.CaseDefinitionVersion).thenReturn(33);
            when(anotherReportResult.HistoryTimeToLive).thenReturn(null);
            when(anotherReportResult.FinishedCaseInstanceCount).thenReturn(13l);
            when(anotherReportResult.CleanableCaseInstanceCount).thenReturn(0l);
            when(anotherReportResult.TenantId).thenReturn(ANOTHER_EXAMPLE_TENANT_ID);


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

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

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

            historicCaseInstanceReport = report;
            when(processEngine.HistoryService.createCleanableHistoricCaseInstanceReport()).thenReturn(historicCaseInstanceReport);
        }