use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentQueryTest method testQueryByTenantId.
public void testQueryByTenantId() {
DeploymentQuery query = repositoryService.createDeploymentQuery().tenantIdIn(TENANT_ONE);
assertThat(query.count(), is(1L));
query = repositoryService.createDeploymentQuery().tenantIdIn(TENANT_TWO);
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class DeploymentQueryTest method testQueryByInvalidDeploymentId.
public void testQueryByInvalidDeploymentId() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentId("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
repositoryService.createDeploymentQuery().deploymentId(null);
fail();
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class DeploymentQueryTest method testQueryByInvalidSource.
public void testQueryByInvalidSource() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentSource("invalid");
assertEquals(0, query.list().size());
assertEquals(0, query.count());
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class DeploymentQueryTest method testQueryByNullSource.
public void testQueryByNullSource() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentSource(null);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testNullAndNotNullDeploymentSourceShouldDeployNewVersion.
public void testNullAndNotNullDeploymentSourceShouldDeployNewVersion() {
// given
String key = "process";
String name = "my-deployment";
BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().processDefinitionKey(key);
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery().deploymentName(name);
// when
ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()).name(name).source(null).addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
assertEquals(1, processDefinitionQuery.count());
assertEquals(1, deploymentQuery.count());
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name(name).source("my-source2").addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
// then
assertEquals(2, processDefinitionQuery.count());
assertEquals(2, deploymentQuery.count());
deleteDeployments(deployment1, deployment2);
}
Aggregations