use of org.camunda.bpm.engine.history.HistoricProcessInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricProcessInstanceQueryTest method testQueryByTenantId.
public void testQueryByTenantId() {
HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().tenantIdIn(TENANT_ONE);
assertThat(query.count(), is(1L));
query = historyService.createHistoricProcessInstanceQuery().tenantIdIn(TENANT_TWO);
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.history.HistoricProcessInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricProcessInstanceQueryTest method testQueryByTenantIds.
public void testQueryByTenantIds() {
HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.history.HistoricProcessInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricProcessInstanceQueryTest method testQueryAuthenticatedTenants.
public void testQueryAuthenticatedTenants() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery();
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.HistoricProcessInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricProcessInstanceQueryTest method testQueryDisabledTenantCheck.
public void testQueryDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery();
assertThat(query.count(), is(2L));
}
use of org.camunda.bpm.engine.history.HistoricProcessInstanceQuery in project camunda-bpm-platform by camunda.
the class SetExternalTasksRetriesTest method shouldSetExternalTaskRetriesWithLargeList.
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void shouldSetExternalTaskRetriesWithLargeList() {
// given
engineRule.getProcessEngineConfiguration().setBatchJobsPerSeed(1010);
List<String> processIds = startProcessInstance(PROCESS_DEFINITION_KEY, 1100);
HistoricProcessInstanceQuery processInstanceQuery = historyService.createHistoricProcessInstanceQuery();
// when
Batch batch = externalTaskService.updateRetries().historicProcessInstanceQuery(processInstanceQuery).setAsync(3);
createAndExecuteSeedJobs(batch.getSeedJobDefinitionId(), 2);
executeBatchJobs(batch);
// then no error is thrown
assertHistoricBatchExists();
// cleanup
if (!testHelper.isHistoryLevelNone()) {
batch = historyService.deleteHistoricProcessInstancesAsync(processIds, null);
createAndExecuteSeedJobs(batch.getSeedJobDefinitionId(), 2);
executeBatchJobs(batch);
}
}
Aggregations