Beispiel #1
0
        public virtual void testGetVariableUpdatesWithoutAuthorization()
        {
            // given
            startProcessInstanceByKey("process");

            try
            {
                // when
                optimizeService.getHistoricVariableUpdates(new DateTime(0L), null, 10);
                fail("Exception expected: It should not be possible to retrieve the activities");
            }
            catch (AuthorizationException e)
            {
                // then
                string exceptionMessage = e.Message;
                assertTextPresent(userId, exceptionMessage);
                assertTextPresent(READ_HISTORY.Name, exceptionMessage);
                assertTextPresent(PROCESS_DEFINITION.resourceName(), exceptionMessage);
            }
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUpRuntimeData()
        public virtual void setUpRuntimeData()
        {
            historicUpdateBuilder = MockProvider.mockHistoricVariableUpdate();
            historicUpdateMock    = historicUpdateBuilder.build();

            mockedOptimizeService = mock(typeof(OptimizeService));
            ProcessEngineConfigurationImpl mockedConfig = mock(typeof(ProcessEngineConfigurationImpl));

            when(mockedOptimizeService.getHistoricVariableUpdates(any(typeof(DateTime)), any(typeof(DateTime)), anyInt())).thenReturn(Arrays.asList(historicUpdateMock));

            namedProcessEngine = getProcessEngine(MockProvider.EXAMPLE_PROCESS_ENGINE_NAME);
            when(namedProcessEngine.ProcessEngineConfiguration).thenReturn(mockedConfig);
            when(mockedConfig.OptimizeService).thenReturn(mockedOptimizeService);
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void getHistoricVariableUpdates()
        public virtual void getHistoricVariableUpdates()
        {
            // given
            BpmnModelInstance simpleDefinition = Bpmn.createExecutableProcess("process").startEvent().endEvent().done();

            testHelper.deploy(simpleDefinition);
            IDictionary <string, object> variables = new Dictionary <string, object>();

            variables["stringVar"] = "foo";
            runtimeService.startProcessInstanceByKey("process", variables);

            // when
            IList <HistoricVariableUpdate> historicVariableUpdates = optimizeService.getHistoricVariableUpdates(new DateTime(1L), null, 10);

            // then
            assertThat(historicVariableUpdates.Count, @is(1));
            assertThatUpdateHasAllImportantInformation(historicVariableUpdates[0]);
        }