protected String deploymentForTenant(String tenantId, BpmnModelInstance... bpmnModelInstances) { DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().tenantId(tenantId); return deployment(deploymentBuilder, bpmnModelInstances); }
protected String deploymentForTenant(String tenantId, String... resources) { DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().tenantId(tenantId); return deployment(deploymentBuilder, resources); }
protected String deploymentForTenant(String tenantId, String... resources) { DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().tenantId(tenantId); return deployment(deploymentBuilder, resources); }
protected String deploymentForTenant(String tenantId, BpmnModelInstance... bpmnModelInstances) { DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().tenantId(tenantId); return deployment(deploymentBuilder, bpmnModelInstances); }
protected String deploymentForTenant(String tenantId, String classpathResource, BpmnModelInstance modelInstance) { return deployment(repositoryService.createDeployment() .tenantId(tenantId) .addClasspathResource(classpathResource), modelInstance); }
protected String deploymentForTenant(String tenantId, String classpathResource, BpmnModelInstance modelInstance) { return deployment(repositoryService.createDeployment() .tenantId(tenantId) .addClasspathResource(classpathResource), modelInstance); }
public Deployment deployForTenant(String tenantId, BpmnModelInstance... bpmnModelInstances) { return deploy(createDeploymentBuilder().tenantId(tenantId), Arrays.asList(bpmnModelInstances), Collections.<String> emptyList()); }
public Deployment deployForTenant(String tenant, BpmnModelInstance bpmnModelInstance, String resource) { return deploy(createDeploymentBuilder().tenantId(tenant), Collections.singletonList(bpmnModelInstance), Collections.singletonList(resource)); }
public Deployment deployForTenant(String tenantId, String... resources) { return deploy(createDeploymentBuilder().tenantId(tenantId), Collections.<BpmnModelInstance> emptyList(), Arrays.asList(resources)); }
@Test public void testCreateDeploymentWithTenantId() throws Exception { resourceNames.addAll( Arrays.asList("data", "more-data") ); given() .multiPart("data", "unspecified", createMockDeploymentResourceByteData()) .multiPart("tenant-id", EXAMPLE_TENANT_ID) .expect() .statusCode(Status.OK.getStatusCode()) .when() .post(CREATE_DEPLOYMENT_URL); verify(mockDeploymentBuilder).tenantId(EXAMPLE_TENANT_ID); }
@Test public void deploymentWithTenantId() { createDeploymentBuilder() .tenantId(TENANT_ONE) .deploy(); Deployment deployment = repositoryService .createDeploymentQuery() .singleResult(); assertThat(deployment, is(notNullValue())); assertThat(deployment.getTenantId(), is(TENANT_ONE)); }
public ProcessDefinition deployForTenantAndGetDefinition(String tenant, BpmnModelInstance bpmnModel) { Deployment deployment = deploy(createDeploymentBuilder().tenantId(tenant), Collections.singletonList(bpmnModel), Collections.<String>emptyList()); return processEngineRule.getRepositoryService() .createProcessDefinitionQuery() .deploymentId(deployment.getId()) .singleResult(); }
protected DeploymentWithDefinitions tryToRedeploy(RedeploymentDto redeployment) { RepositoryService repositoryService = getProcessEngine().getRepositoryService(); DeploymentBuilder builder = repositoryService.createDeployment(); builder.nameFromDeployment(deploymentId); String tenantId = getDeployment().getTenantId(); if (tenantId != null) { builder.tenantId(tenantId); } if (redeployment != null) { builder = addRedeploymentResources(builder, redeployment); } else { builder.addDeploymentResources(deploymentId); } return builder.deployWithResult(); }
@Test public 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)); }
@Test public void createDeploymentDisabledTenantCheck() { processEngineConfiguration.setTenantCheckEnabled(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)); }
@Test public void createDeploymentForAnotherTenant() { identityService.setAuthentication("user", null, null); 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)); }
public void testPropagateTenantIdToCandidateStarterUser() { // when org.camunda.bpm.engine.repository.Deployment deployment = repositoryService.createDeployment() .addClasspathResource(CANDIDATE_STARTER_USER) .tenantId(TENANT_ONE) .deploy(); // then List<HistoricIdentityLinkLog> historicLinks = historyService.createHistoricIdentityLinkLogQuery().list(); assertEquals(historicLinks.size(), 1); HistoricIdentityLinkLog historicLink = historicLinks.get(0); assertNotNull(historicLink.getTenantId()); assertEquals(TENANT_ONE, historicLink.getTenantId()); repositoryService.deleteDeployment(deployment.getId(), true); }
public void testPropagateTenantIdToCandidateStarterGroup() { // when org.camunda.bpm.engine.repository.Deployment deployment = repositoryService.createDeployment() .addClasspathResource(CANDIDATE_STARTER_GROUP) .tenantId(TENANT_ONE) .deploy(); // then List<HistoricIdentityLinkLog> historicLinks = historyService.createHistoricIdentityLinkLogQuery().list(); assertEquals(historicLinks.size(), 1); HistoricIdentityLinkLog historicLink = historicLinks.get(0); assertNotNull(historicLink.getTenantId()); assertEquals(TENANT_ONE, historicLink.getTenantId()); repositoryService.deleteDeployment(deployment.getId(), true); }
@Test public void shouldPropagateTenantIdToCandidateStarterUser() { // when DeploymentBuilder builder = repositoryService.createDeployment() .addClasspathResource(CANDIDATE_STARTER_USER) .tenantId(TENANT_ONE); testRule.deploy(builder); // then ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult(); List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId()); assertEquals(1, links.size()); IdentityLink link = links.get(0); assertNotNull(link.getTenantId()); assertEquals(TENANT_ONE, link.getTenantId()); }
public void testPropagateTenantIdToCandidateStarterUsers() { // when org.camunda.bpm.engine.repository.Deployment deployment = repositoryService.createDeployment() .addClasspathResource(CANDIDATE_STARTER_USERS) .tenantId(TENANT_ONE) .deploy(); // then List<HistoricIdentityLinkLog> historicLinks = historyService.createHistoricIdentityLinkLogQuery().list(); assertEquals(3, historicLinks.size()); for (HistoricIdentityLinkLog historicLink : historicLinks) { assertNotNull(historicLink.getTenantId()); assertEquals(TENANT_ONE, historicLink.getTenantId()); } repositoryService.deleteDeployment(deployment.getId(), true); }