コード例 #1
0
        public virtual void testGetRunningActivitiesWithoutAuthorization()
        {
            // given
            startProcessInstanceByKey("process");

            try
            {
                // when
                optimizeService.getRunningHistoricActivityInstances(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);
            }
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void getRunningHistoricActivityInstances()
        public virtual void getRunningHistoricActivityInstances()
        {
            // given
            BpmnModelInstance simpleDefinition = Bpmn.createExecutableProcess("process").startEvent("startEvent").name("start").userTask("userTask").name("task").endEvent("endEvent").name("end").done();

            testHelper.deploy(simpleDefinition);
            runtimeService.startProcessInstanceByKey("process");

            // when
            IList <HistoricActivityInstance> runningHistoricActivityInstances = optimizeService.getRunningHistoricActivityInstances(pastDate(), null, 10);

            // then
            assertThat(runningHistoricActivityInstances.Count, @is(1));
            HistoricActivityInstance activityInstance = runningHistoricActivityInstances[0];

            assertThatActivitiesHaveAllImportantInformation(activityInstance);
        }