use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessDefinitionSuspensionStateTest method suspendProcessDefinitionNoAuthenticatedTenants.
@Test
public void suspendProcessDefinitionNoAuthenticatedTenants() {
// given activated process definitions
ProcessDefinitionQuery query = engineRule.getRepositoryService().createProcessDefinitionQuery();
assertThat(query.active().count(), is(3L));
assertThat(query.suspended().count(), is(0L));
engineRule.getIdentityService().setAuthentication("user", null, null);
engineRule.getRepositoryService().updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();
engineRule.getIdentityService().clearAuthentication();
assertThat(query.active().count(), is(2L));
assertThat(query.suspended().count(), is(1L));
assertThat(query.suspended().withoutTenantId().count(), is(1L));
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessDefinitionQueryTest method testQueryDisabledTenantCheck.
public void testQueryDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessDefinitionQueryTest method testQueryByDefinitionsWithoutTenantId.
public void testQueryByDefinitionsWithoutTenantId() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().withoutTenantId();
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessDefinitionQueryTest method testQueryNoTenantIdSet.
public void testQueryNoTenantIdSet() {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.repository.ProcessDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessDefinitionQueryTest method testQueryByLatestWithTenantIdsIncludeDefinitionsWithoutTenantId.
public void testQueryByLatestWithTenantIdsIncludeDefinitionsWithoutTenantId() {
// deploy a second version without tenant id
deployment(emptyProcess);
// deploy a third version for tenant one
deploymentForTenant(TENANT_ONE, emptyProcess);
deploymentForTenant(TENANT_ONE, emptyProcess);
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionKey(PROCESS_DEFINITION_KEY).latestVersion().tenantIdIn(TENANT_ONE, TENANT_TWO).includeProcessDefinitionsWithoutTenantId();
assertThat(query.count(), is(3L));
Map<String, ProcessDefinition> processDefinitionsForTenant = getProcessDefinitionsForTenant(query.list());
assertThat(processDefinitionsForTenant.get(TENANT_ONE).getVersion(), is(3));
assertThat(processDefinitionsForTenant.get(TENANT_TWO).getVersion(), is(1));
assertThat(processDefinitionsForTenant.get(null).getVersion(), is(2));
}
Aggregations