Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldLogIncidentResolution()
        public virtual void shouldLogIncidentResolution()
        {
            // given
            testRule.deploy(ProcessModels.TWO_TASKS_PROCESS);
            ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("Process");
            Incident        incident        = runtimeService.createIncident("foo", processInstance.Id, "userTask1", "bar");

            assertEquals(0, historyService.createUserOperationLogQuery().count());

            // when
            identityService.AuthenticatedUserId = "userId";
            runtimeService.resolveIncident(incident.Id);
            identityService.clearAuthentication();

            // then
            assertEquals(1, historyService.createUserOperationLogQuery().count());
            UserOperationLogEntry entry = historyService.createUserOperationLogQuery().singleResult();

            assertEquals(org.camunda.bpm.engine.history.UserOperationLogEntry_Fields.OPERATION_TYPE_RESOLVE, entry.OperationType);
            assertEquals(EntityTypes.PROCESS_INSTANCE, entry.EntityType);
            assertEquals(org.camunda.bpm.engine.history.UserOperationLogEntry_Fields.CATEGORY_OPERATOR, entry.Category);
            assertEquals("incidentId", entry.Property);
            assertNull(entry.OrgValue);
            assertEquals(incident.Id, entry.NewValue);
            assertNull(entry.ExecutionId);
            assertEquals(processInstance.Id, entry.ProcessInstanceId);
            assertEquals(processInstance.ProcessDefinitionId, entry.ProcessDefinitionId);
            assertEquals("Process", entry.ProcessDefinitionKey);
        }