Search in sources :

Example 61 with Deployment

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();
}
Also used : Deployment(org.camunda.bpm.engine.repository.Deployment) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance)

Example 62 with Deployment

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;
}
Also used : Deployment(org.camunda.bpm.engine.repository.Deployment) After(org.junit.After)

Example 63 with Deployment

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);
}
Also used : Response(com.jayway.restassured.response.Response) Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Example 64 with Deployment

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);
}
Also used : Response(com.jayway.restassured.response.Response) Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Example 65 with Deployment

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);
}
Also used : Response(com.jayway.restassured.response.Response) Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Aggregations

Deployment (org.camunda.bpm.engine.repository.Deployment)137 Test (org.junit.Test)62 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)39 ProcessApplicationDeployment (org.camunda.bpm.engine.repository.ProcessApplicationDeployment)36 ProcessDefinitionQuery (org.camunda.bpm.engine.repository.ProcessDefinitionQuery)19 Resource (org.camunda.bpm.engine.repository.Resource)19 InputStream (java.io.InputStream)14 DeploymentBuilder (org.camunda.bpm.engine.repository.DeploymentBuilder)11 DeploymentQuery (org.camunda.bpm.engine.repository.DeploymentQuery)11 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)10 UserOperationLogQuery (org.camunda.bpm.engine.history.UserOperationLogQuery)10 JobDefinitionQuery (org.camunda.bpm.engine.management.JobDefinitionQuery)10 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)9 UserOperationLogEntry (org.camunda.bpm.engine.history.UserOperationLogEntry)8 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)8 RepositoryService (org.camunda.bpm.engine.RepositoryService)4 Job (org.camunda.bpm.engine.runtime.Job)4 Response (com.jayway.restassured.response.Response)3 HashMap (java.util.HashMap)2 Authorization (org.camunda.bpm.engine.authorization.Authorization)2