use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricDetailFormPropertyQueryTest method testQueryAuthenticatedTenant.
public void testQueryAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
HistoricDetailQuery query = historyService.createHistoricDetailQuery();
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.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricDetailFormPropertyQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
HistoricDetailQuery query = historyService.createHistoricDetailQuery().formFields().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricDetailFormPropertyQueryTest method testQueryByTenantId.
public void testQueryByTenantId() {
HistoricDetailQuery query = historyService.createHistoricDetailQuery().formFields().tenantIdIn(TENANT_ONE);
assertThat(query.count(), is(1L));
query = historyService.createHistoricDetailQuery().formFields().tenantIdIn(TENANT_TWO);
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricDetailFormPropertyQueryTest method testQueryNoAuthenticatedTenants.
public void testQueryNoAuthenticatedTenants() {
identityService.setAuthentication("user", null, null);
HistoricDetailQuery query = historyService.createHistoricDetailQuery();
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class HistoricDetailAuthorizationTest method testVariableUpdateQueryWithReadHistoryPermissionOnAnyProcessDefinition.
public void testVariableUpdateQueryWithReadHistoryPermissionOnAnyProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY, getVariables());
startProcessInstanceByKey(PROCESS_KEY, getVariables());
startProcessInstanceByKey(PROCESS_KEY, getVariables());
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY, getVariables());
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY, getVariables());
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY, getVariables());
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY, getVariables());
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
// when
HistoricDetailQuery query = historyService.createHistoricDetailQuery().variableUpdates();
// then
verifyQueryResults(query, 7);
}
Aggregations