Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void sendSignalToStartAndIntermediateCatchEventDisabledTenantCheck()
        public virtual void sendSignalToStartAndIntermediateCatchEventDisabledTenantCheck()
        {
            testRule.deployForTenant(TENANT_ONE, SIGNAL_START_PROCESS, SIGNAL_CATCH_PROCESS);
            testRule.deployForTenant(TENANT_TWO, SIGNAL_START_PROCESS, SIGNAL_CATCH_PROCESS);

            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_ONE).execute();
            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_TWO).execute();

            engineRule.ProcessEngineConfiguration.TenantCheckEnabled = false;
            engineRule.IdentityService.setAuthentication("user", null, null);

            engineRule.RuntimeService.createSignalEvent("signal").send();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(4L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(2L));
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void correlateMessageToIntermediateCatchEventWithAuthenticatedTenant()
        public virtual void correlateMessageToIntermediateCatchEventWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, MESSAGE_CATCH_PROCESS);
            testRule.deployForTenant(TENANT_TWO, MESSAGE_CATCH_PROCESS);

            engineRule.RuntimeService.createProcessInstanceByKey("messageCatch").processDefinitionTenantId(TENANT_ONE).execute();
            engineRule.RuntimeService.createProcessInstanceByKey("messageCatch").processDefinitionTenantId(TENANT_TWO).execute();

            engineRule.IdentityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            engineRule.RuntimeService.createMessageCorrelation("message").correlate();

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(0L));
        }
Exemple #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void sendSignalToStartAndIntermediateCatchEventWithAuthenticatedTenant()
        public virtual void sendSignalToStartAndIntermediateCatchEventWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, SIGNAL_START_PROCESS, SIGNAL_CATCH_PROCESS);
            testRule.deployForTenant(TENANT_TWO, SIGNAL_START_PROCESS, SIGNAL_CATCH_PROCESS);

            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_ONE).execute();
            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_TWO).execute();

            engineRule.IdentityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            engineRule.RuntimeService.createSignalEvent("signal").send();

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(0L));
        }
Exemple #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void signalIntermediateCatchEventDisabledTenantCheck()
        public virtual void signalIntermediateCatchEventDisabledTenantCheck()
        {
            testRule.deployForTenant(TENANT_ONE, SIGNAL_CATCH_PROCESS);
            testRule.deployForTenant(TENANT_TWO, SIGNAL_CATCH_PROCESS);

            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_ONE).execute();
            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_TWO).execute();

            Execution execution = engineRule.RuntimeService.createExecutionQuery().processDefinitionKey("signalCatch").signalEventSubscriptionName("signal").tenantIdIn(TENANT_ONE).singleResult();

            engineRule.ProcessEngineConfiguration.TenantCheckEnabled = false;
            engineRule.IdentityService.setAuthentication("user", null, null);

            engineRule.RuntimeService.signal(execution.Id, "signal", null, null);

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(0L));
        }
Exemple #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void correlateMessageByProcessDefinitionIdWithAuthenticatedTenant()
        public virtual void correlateMessageByProcessDefinitionIdWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, MESSAGE_START_PROCESS);

            ProcessDefinition processDefinition = engineRule.RepositoryService.createProcessDefinitionQuery().processDefinitionKey("messageStart").singleResult();

            engineRule.IdentityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            engineRule.RuntimeService.createMessageCorrelation("message").processDefinitionId(processDefinition.Id).correlateStartMessage();

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
        }
Exemple #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void sendSignalToIntermediateCatchEventWithExecutionIdAndAuthenticatedTenant()
        public virtual void sendSignalToIntermediateCatchEventWithExecutionIdAndAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, SIGNAL_CATCH_PROCESS);

            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_ONE).execute();

            Execution execution = engineRule.RuntimeService.createExecutionQuery().processDefinitionKey("signalCatch").signalEventSubscriptionName("signal").singleResult();

            engineRule.IdentityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            engineRule.RuntimeService.createSignalEvent("signal").executionId(execution.Id).send();

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
        }
Exemple #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void correlateReceivedMessageToIntermediateCatchEventWithAuthenticatedTenant()
        public virtual void correlateReceivedMessageToIntermediateCatchEventWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, MESSAGE_CATCH_PROCESS);

            engineRule.RuntimeService.createProcessInstanceByKey("messageCatch").execute();

            Execution execution = engineRule.RuntimeService.createExecutionQuery().processDefinitionKey("messageCatch").messageEventSubscriptionName("message").singleResult();

            engineRule.IdentityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            engineRule.RuntimeService.messageEventReceived("message", execution.Id);

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
        }
Exemple #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void correlateMessageToStartAndIntermediateCatchEventWithNoAuthenticatedTenants()
        public virtual void correlateMessageToStartAndIntermediateCatchEventWithNoAuthenticatedTenants()
        {
            testRule.deploy(MESSAGE_START_PROCESS, MESSAGE_CATCH_PROCESS);
            testRule.deployForTenant(TENANT_ONE, MESSAGE_START_PROCESS, MESSAGE_CATCH_PROCESS);

            engineRule.RuntimeService.createProcessInstanceByKey("messageCatch").processDefinitionWithoutTenantId().execute();
            engineRule.RuntimeService.createProcessInstanceByKey("messageCatch").processDefinitionTenantId(TENANT_ONE).execute();

            engineRule.IdentityService.setAuthentication("user", null, null);

            engineRule.RuntimeService.createMessageCorrelation("message").correlateAll();

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(2L));
            assertThat(query.withoutTenantId().count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(0L));
        }