예제 #1
0
        public virtual void testQueryAuthenticatedTenants()
        {
            identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));

            DeploymentQuery query = repositoryService.createDeploymentQuery();

            assertThat(query.count(), @is(3L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(1L));
            assertThat(query.withoutTenantId().count(), @is(1L));
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void createDeploymentDisabledTenantCheck()
        public virtual void createDeploymentDisabledTenantCheck()
        {
            processEngineConfiguration.TenantCheckEnabled = false;
            identityService.setAuthentication("user", null, null);

            repositoryService.createDeployment().addModelInstance("emptyProcessOne", emptyProcess).tenantId(TENANT_ONE).deploy();
            repositoryService.createDeployment().addModelInstance("emptyProcessTwo", startEndProcess).tenantId(TENANT_TWO).deploy();

            DeploymentQuery query = repositoryService.createDeploymentQuery();

            assertThat(query.count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(1L));
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void redeployForDifferentAuthenticatedTenantsDisabledTenantCheck()
        public virtual void redeployForDifferentAuthenticatedTenantsDisabledTenantCheck()
        {
            Deployment deploymentOne = repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess).addModelInstance("startEndProcess.bpmn", startEndProcess).tenantId(TENANT_ONE).deploy();

            identityService.setAuthentication("user", null, null);
            processEngineConfiguration.TenantCheckEnabled = false;

            repositoryService.createDeployment().addDeploymentResources(deploymentOne.Id).tenantId(TENANT_TWO).deploy();

            DeploymentQuery query = repositoryService.createDeploymentQuery();

            assertThat(query.count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(1L));
        }
예제 #4
0
        public virtual void testAutoDeployTenantId()
        {
            createAppContext(CTX_TENANT_ID_PATH);

            DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();

            assertEquals(1, deploymentQuery.tenantIdIn("tenant1").count());
        }
예제 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void deleteDeploymentDisabledTenantCheck()
        public virtual void deleteDeploymentDisabledTenantCheck()
        {
            Deployment deploymentOne = testRule.deployForTenant(TENANT_ONE, emptyProcess);
            Deployment deploymentTwo = testRule.deployForTenant(TENANT_TWO, startEndProcess);

            processEngineConfiguration.TenantCheckEnabled = false;
            identityService.setAuthentication("user", null, null);

            repositoryService.deleteDeployment(deploymentOne.Id);
            repositoryService.deleteDeployment(deploymentTwo.Id);

            DeploymentQuery query = repositoryService.createDeploymentQuery();

            assertThat(query.count(), @is(0L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(0L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(0L));
        }
예제 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void redeployForTheSameAuthenticatedTenant()
        public virtual void redeployForTheSameAuthenticatedTenant()
        {
            Deployment deploymentOne = repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess).addModelInstance("startEndProcess.bpmn", startEndProcess).tenantId(TENANT_ONE).deploy();

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

            repositoryService.createDeployment().addDeploymentResources(deploymentOne.Id).tenantId(TENANT_ONE).deploy();

            DeploymentQuery query = repositoryService.createDeploymentQuery();

            assertThat(query.count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(2L));
        }
예제 #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void createDeploymentWithAuthenticatedTenant()
        public virtual void createDeploymentWithAuthenticatedTenant()
        {
            identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess).tenantId(TENANT_ONE).deploy();

            identityService.clearAuthentication();

            DeploymentQuery query = repositoryService.createDeploymentQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
        }
예제 #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void deleteDeploymentWithAuthenticatedTenant()
        public virtual void deleteDeploymentWithAuthenticatedTenant()
        {
            Deployment deployment = testRule.deployForTenant(TENANT_ONE, emptyProcess);

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

            repositoryService.deleteDeployment(deployment.Id);

            identityService.clearAuthentication();

            DeploymentQuery query = repositoryService.createDeploymentQuery();

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