use of org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricExternalTaskLogTest method testQueryAuthenticatedTenant.
@Test
public void testQueryAuthenticatedTenant() {
// given
identityService.setAuthentication("user", null, Collections.singletonList(TENANT_ONE));
// when
HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
// then
assertThat(query.count(), is(2L));
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(2L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
assertThat(query.tenantIdIn(TENANT_ONE, TENANT_TWO).count(), is(2L));
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricExternalTaskLogTest method testQueryByTenantId.
@Test
public void testQueryByTenantId() {
// given two process with different tenants
// when
HistoricExternalTaskLogQuery queryTenant1 = historyService.createHistoricExternalTaskLogQuery().tenantIdIn(TENANT_ONE);
HistoricExternalTaskLogQuery queryTenant2 = historyService.createHistoricExternalTaskLogQuery().tenantIdIn(TENANT_TWO);
// then
assertThat(queryTenant1.count(), is(2L));
assertThat(queryTenant2.count(), is(3L));
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricExternalTaskLogTest method testQueryByNonExistingTenantId.
@Test
public void testQueryByNonExistingTenantId() {
// given two process with different tenants
// when
HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery().tenantIdIn("nonExisting");
// then
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQuerySortingTest method testQuerySortingByActivityIdAsc.
@Test
public void testQuerySortingByActivityIdAsc() {
// given
int taskCount = 10;
startProcessesByActivityId(taskCount);
// when
HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
query.orderByActivityId().asc();
// then
verifyQueryWithOrdering(query, taskCount, historicExternalTaskLogByActivityId());
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQuerySortingTest method testQuerySortingByExecutionIdAsc.
@Test
public void testQuerySortingByExecutionIdAsc() {
// given
int taskCount = 10;
startProcesses(taskCount);
// when
HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
query.orderByExecutionId().asc();
// then
verifyQueryWithOrdering(query, taskCount, historicExternalTaskLogByExecutionId());
}
Aggregations