use of org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricCaseActivityInstanceQueryTest method testQueryAuthenticatedTenant.
public void testQueryAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
HistoricCaseActivityInstanceQuery query = historyService.createHistoricCaseActivityInstanceQuery();
assertThat(query.count(), is(1L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
assertThat(query.tenantIdIn(TENANT_ONE, TENANT_TWO).count(), is(1L));
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricCaseActivityInstanceQueryTest method testQueryNoAuthenticatedTenants.
public void testQueryNoAuthenticatedTenants() {
identityService.setAuthentication("user", null, null);
HistoricCaseActivityInstanceQuery query = historyService.createHistoricCaseActivityInstanceQuery();
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricCaseActivityInstanceQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
HistoricCaseActivityInstanceQuery query = historyService.createHistoricCaseActivityInstanceQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricCaseActivityInstanceQueryTest method testQueryByNonExistingTenantId.
public void testQueryByNonExistingTenantId() {
HistoricCaseActivityInstanceQuery query = historyService.createHistoricCaseActivityInstanceQuery().tenantIdIn("nonExisting");
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricCaseActivityInstanceTest method testQueryByCaseInstanceIds.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn" })
public void testQueryByCaseInstanceIds() {
// given
CaseInstance instance1 = createCaseInstance();
CaseInstance instance2 = createCaseInstance();
String taskInstanceId1 = caseService.createCaseExecutionQuery().caseInstanceId(instance1.getId()).activityId("PI_HumanTask_1").singleResult().getId();
String taskInstanceId2 = caseService.createCaseExecutionQuery().caseInstanceId(instance2.getId()).activityId("PI_HumanTask_1").singleResult().getId();
// when
HistoricCaseActivityInstanceQuery query = historicQuery().caseActivityInstanceIdIn(taskInstanceId1, taskInstanceId2);
// then
assertCount(2, query);
}
Aggregations