use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseDefinitionQueryTest method testQueryAuthenticatedTenants.
public void testQueryAuthenticatedTenants() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
assertThat(query.count(), is(3L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
assertThat(query.withoutTenantId().count(), is(1L));
}
use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseDefinitionQueryTest method testQueryDisabledTenantCheck.
public void testQueryDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class RepositoryServiceTest method testGetCaseDefinition.
@Deployment(resources = { "org/camunda/bpm/engine/test/repository/one.cmmn" })
public void testGetCaseDefinition() {
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
CaseDefinition caseDefinition = query.singleResult();
String caseDefinitionId = caseDefinition.getId();
CaseDefinition definition = repositoryService.getCaseDefinition(caseDefinitionId);
assertNotNull(definition);
assertEquals(caseDefinitionId, definition.getId());
}
use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class CaseDefinitionQueryTest method testQueryByInvalidCategory.
public void testQueryByInvalidCategory() {
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
query.caseDefinitionCategory("invalid");
verifyQueryResults(query, 0);
try {
query.caseDefinitionCategory(null);
fail();
} catch (NotValidException e) {
// Expected exception
}
}
use of org.camunda.bpm.engine.repository.CaseDefinitionQuery in project camunda-bpm-platform by camunda.
the class CaseDefinitionQueryTest method testQueryByInvalidDeploymentId.
public void testQueryByInvalidDeploymentId() {
CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();
query.deploymentId("invalid");
verifyQueryResults(query, 0);
try {
query.deploymentId(null);
fail();
} catch (NotValidException e) {
// Expected exception
}
}
Aggregations