use of org.camunda.bpm.engine.externaltask.ExternalTaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyProcessInstanceSuspensionStateTest method suspendProcessInstanceIncludingExternalTaskForNonTenant.
@Test
public void suspendProcessInstanceIncludingExternalTaskForNonTenant() {
// given activated external tasks
ExternalTaskQuery query = engineRule.getExternalTaskService().createExternalTaskQuery();
assertThat(query.active().count(), is(3L));
assertThat(query.suspended().count(), is(0L));
engineRule.getRuntimeService().updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionWithoutTenantId().suspend();
assertThat(query.active().count(), is(2L));
assertThat(query.suspended().count(), is(1L));
assertThat(query.suspended().singleResult().getTenantId(), is(nullValue()));
}
use of org.camunda.bpm.engine.externaltask.ExternalTaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyExternalTaskQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
ExternalTaskQuery query = externalTaskService.createExternalTaskQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.externaltask.ExternalTaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyExternalTaskQueryTest method testQueryAuthenticatedTenants.
public void testQueryAuthenticatedTenants() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();
assertThat(query.count(), is(2L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
use of org.camunda.bpm.engine.externaltask.ExternalTaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyExternalTaskQueryTest method testQueryDisabledTenantCheck.
public void testQueryDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.externaltask.ExternalTaskQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyExternalTaskQueryTest method testQueryWithoutTenantId.
public void testQueryWithoutTenantId() {
ExternalTaskQuery query = externalTaskService.createExternalTaskQuery();
assertThat(query.count(), is(2L));
}
Aggregations