use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceAuthorizationTest method testQueryWithReadPermissionOnDecisionDefinition.
public void testQueryWithReadPermissionOnDecisionDefinition() {
// given
startProcessInstanceAndEvaluateDecision();
createGrantAuthorization(DECISION_DEFINITION, DECISION_DEFINITION_KEY, userId, READ_HISTORY);
// when
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
// then
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricDecisionInstanceQueryTest method testQueryAuthenticatedTenants.
public void testQueryAuthenticatedTenants() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
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.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricDecisionInstanceQueryTest method testQueryWithoutTenantId.
public void testQueryWithoutTenantId() {
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricDecisionInstanceQueryTest method testQueryByTenantId.
public void testQueryByTenantId() {
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery().tenantIdIn(TENANT_ONE);
assertThat(query.count(), is(1L));
query = historyService.createHistoricDecisionInstanceQuery().tenantIdIn(TENANT_TWO);
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class BatchHistoricDecisionInstanceDeletionAuthorizationTest method executeBatch.
@Test
public void executeBatch() {
// given
authRule.init(scenario).withUser("userId").start();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery().decisionDefinitionKey(DECISION);
Batch batch = historyService.deleteHistoricDecisionInstancesAsync(decisionInstanceIds, query, null);
if (batch != null) {
Job job = managementService.createJobQuery().jobDefinitionId(batch.getSeedJobDefinitionId()).singleResult();
// seed job
managementService.executeJob(job.getId());
for (Job pending : managementService.createJobQuery().jobDefinitionId(batch.getBatchJobDefinitionId()).list()) {
managementService.executeJob(pending.getId());
}
}
// then
authRule.assertScenario(scenario);
}
Aggregations