use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricTaskInstanceQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricTaskInstanceQueryTest method testQueryDisabledTenantCheck.
public void testQueryDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricTaskInstanceQueryTest method testQueryByTenantId.
public void testQueryByTenantId() {
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery().tenantIdIn(TENANT_ONE);
assertThat(query.count(), is(1L));
query = historyService.createHistoricTaskInstanceQuery().tenantIdIn(TENANT_TWO);
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceAuthorizationTest method testMixedQueryWithReadHistoryPermissionOnProcessDefinition.
public void testMixedQueryWithReadHistoryPermissionOnProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
startProcessInstanceByKey(PROCESS_KEY);
startProcessInstanceByKey(PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY);
createTask("one");
createTask("two");
createTask("three");
createTask("four");
createTask("five");
createCaseInstanceByKey(CASE_KEY);
createCaseInstanceByKey(CASE_KEY);
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, READ_HISTORY);
// when
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
// then
verifyQueryResults(query, 10);
deleteTask("one", true);
deleteTask("two", true);
deleteTask("three", true);
deleteTask("four", true);
deleteTask("five", true);
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceAuthorizationTest method testDeleteProcessTaskWithDeleteHistoryPermissionOnAnyProcessDefinition.
public void testDeleteProcessTaskWithDeleteHistoryPermissionOnAnyProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, DELETE_HISTORY);
// when
historyService.deleteHistoricTaskInstance(taskId);
// then
disableAuthorization();
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery().taskId(taskId);
verifyQueryResults(query, 0);
enableAuthorization();
}
Aggregations