use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class SpinScriptTaskSupportTest method deployProcess.
protected void deployProcess(String scriptFormat, String scriptText) {
BpmnModelInstance process = createProcess(scriptFormat, scriptText);
Deployment deployment = repositoryService.createDeployment().addModelInstance("testProcess.bpmn", process).deploy();
deploymentId = deployment.getId();
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class ProcessStartingBeanPostProcessorTest method after.
@After
public void after() {
for (Deployment deployment : repositoryService.createDeploymentQuery().list()) {
repositoryService.deleteDeployment(deployment.getId(), true);
}
processEngine.close();
processEngine = null;
processInitiatingPojo = null;
repositoryService = null;
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class DeploymentRestServiceQueryTest method testDeploymentTenantIdIncludeDefinitionsWithoutTenantid.
@Test
public void testDeploymentTenantIdIncludeDefinitionsWithoutTenantid() {
List<Deployment> mockDeployments = Arrays.asList(MockProvider.createMockDeployment(null), MockProvider.createMockDeployment(MockProvider.EXAMPLE_TENANT_ID));
mockedQuery = setUpMockDeploymentQuery(mockDeployments);
Response response = given().queryParam("tenantIdIn", MockProvider.EXAMPLE_TENANT_ID).queryParam("includeDeploymentsWithoutTenantId", true).then().expect().statusCode(Status.OK.getStatusCode()).when().get(DEPLOYMENT_QUERY_URL);
verify(mockedQuery).tenantIdIn(MockProvider.EXAMPLE_TENANT_ID);
verify(mockedQuery).includeDeploymentsWithoutTenantId();
verify(mockedQuery).list();
String content = response.asString();
List<String> definitions = from(content).getList("");
assertThat(definitions).hasSize(2);
String returnedTenantId1 = from(content).getString("[0].tenantId");
String returnedTenantId2 = from(content).getString("[1].tenantId");
assertThat(returnedTenantId1).isEqualTo(null);
assertThat(returnedTenantId2).isEqualTo(MockProvider.EXAMPLE_TENANT_ID);
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class DeploymentRestServiceQueryTest method testDeploymentTenantIdList.
@Test
public void testDeploymentTenantIdList() {
List<Deployment> deployments = Arrays.asList(MockProvider.createMockDeployment(MockProvider.EXAMPLE_TENANT_ID), MockProvider.createMockDeployment(MockProvider.ANOTHER_EXAMPLE_TENANT_ID));
mockedQuery = setUpMockDeploymentQuery(deployments);
Response response = given().queryParam("tenantIdIn", MockProvider.EXAMPLE_TENANT_ID_LIST).then().expect().statusCode(Status.OK.getStatusCode()).when().get(DEPLOYMENT_QUERY_URL);
verify(mockedQuery).tenantIdIn(MockProvider.EXAMPLE_TENANT_ID, MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
verify(mockedQuery).list();
String content = response.asString();
List<String> definitions = from(content).getList("");
assertThat(definitions).hasSize(2);
String returnedTenantId1 = from(content).getString("[0].tenantId");
String returnedTenantId2 = from(content).getString("[1].tenantId");
assertThat(returnedTenantId1).isEqualTo(MockProvider.EXAMPLE_TENANT_ID);
assertThat(returnedTenantId2).isEqualTo(MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class DeploymentRestServiceQueryTest method testDeploymentWithoutTenantId.
@Test
public void testDeploymentWithoutTenantId() {
Deployment mockDeployment = MockProvider.createMockDeployment(null);
mockedQuery = setUpMockDeploymentQuery(Collections.singletonList(mockDeployment));
Response response = given().queryParam("withoutTenantId", true).then().expect().statusCode(Status.OK.getStatusCode()).when().get(DEPLOYMENT_QUERY_URL);
verify(mockedQuery).withoutTenantId();
verify(mockedQuery).list();
String content = response.asString();
List<String> definitions = from(content).getList("");
assertThat(definitions).hasSize(1);
String returnedTenantId1 = from(content).getString("[0].tenantId");
assertThat(returnedTenantId1).isEqualTo(null);
}
Aggregations