use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentQueryTest method testQueryDisabledTenantCheck.
public void testQueryDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
DeploymentQuery query = repositoryService.createDeploymentQuery();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDeploymentQueryTest method testQueryByTenantIdsIncludeDeploymentsWithoutTenantId.
public void testQueryByTenantIdsIncludeDeploymentsWithoutTenantId() {
DeploymentQuery query = repositoryService.createDeploymentQuery().tenantIdIn(TENANT_ONE).includeDeploymentsWithoutTenantId();
assertThat(query.count(), is(2L));
query = repositoryService.createDeploymentQuery().tenantIdIn(TENANT_TWO).includeDeploymentsWithoutTenantId();
assertThat(query.count(), is(2L));
query = repositoryService.createDeploymentQuery().tenantIdIn(TENANT_ONE, TENANT_TWO).includeDeploymentsWithoutTenantId();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class RedeploymentTest method testRedeployNewDeployment.
public void testRedeployNewDeployment() {
// given
BpmnModelInstance model = createProcessWithServiceTask(PROCESS_KEY);
Deployment deployment1 = repositoryService.createDeployment().name(DEPLOYMENT_NAME).addModelInstance(RESOURCE_NAME, model).deploy();
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentName(DEPLOYMENT_NAME);
assertNotNull(deployment1.getId());
verifyQueryResults(query, 1);
// when
Deployment deployment2 = repositoryService.createDeployment().name(DEPLOYMENT_NAME).addDeploymentResources(deployment1.getId()).deploy();
// then
assertNotNull(deployment2);
assertNotNull(deployment2.getId());
assertFalse(deployment1.getId().equals(deployment2.getId()));
verifyQueryResults(query, 2);
deleteDeployments(deployment1, deployment2);
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class DeploymentQueryTest method testQueryNoCriteria.
public void testQueryNoCriteria() {
DeploymentQuery query = repositoryService.createDeploymentQuery();
assertEquals(2, query.list().size());
assertEquals(2, query.count());
try {
query.singleResult();
fail();
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.
the class DeploymentQueryTest method testQueryByInvalidName.
public void testQueryByInvalidName() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentName("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
repositoryService.createDeploymentQuery().deploymentName(null);
fail();
} catch (ProcessEngineException e) {
}
}
Aggregations