public virtual void getProcessModelDisabledTenantCheck()
        {
            processEngineConfiguration.SetTenantCheckEnabled(false);
            identityService.SetAuthentication("user", null, null);

            System.IO.Stream inputStream = repositoryService.GetProcessModel(processDefinitionId);

            Assert.That(inputStream != null);
        }
        public virtual void suspendProcessDefinitionDisabledTenantCheck()
        {
            // given activated process definitions
            IQueryable <IProcessDefinition> query = engineRule.RepositoryService.CreateProcessDefinitionQuery();

            Assert.That(query.Where(c => c.SuspensionState == SuspensionStateFields.Active.StateCode).Count(), Is.EqualTo(3L));
            Assert.That(query.Where(c => c.SuspensionState == SuspensionStateFields.Suspended.StateCode).Count(), Is.EqualTo(0L));

            ProcessEngineConfigurationImpl processEngineConfiguration = engineRule.ProcessEngineConfiguration;

            processEngineConfiguration.SetTenantCheckEnabled(false);
            engineRule.IdentityService.SetAuthentication("user", null, null);

            engineRule.RepositoryService.UpdateProcessDefinitionSuspensionState().ByProcessDefinitionKey(PROCESS_DEFINITION_KEY).Suspend();

            Assert.That(query.Where(c => c.SuspensionState == SuspensionStateFields.Active.StateCode).Count(), Is.EqualTo(0L));
            Assert.That(query.Where(c => c.SuspensionState == SuspensionStateFields.Suspended.StateCode).Count(), Is.EqualTo(3L));
            Assert.That(query.Where(c => c.SuspensionState == SuspensionStateFields.Suspended.StateCode && new [] { TENANT_ONE, TENANT_TWO }.Contains(c.TenantId))
                        //.IncludeProcessDefinitionsWithoutTenantId()
                        .Count(), Is.EqualTo(3L));
        }