use of org.camunda.bpm.engine.management.ProcessDefinitionStatisticsQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyStatisticsQueryTest method testQueryDisabledTenantCheckForProcessDefinitionStatistics.
public void testQueryDisabledTenantCheckForProcessDefinitionStatistics() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
ProcessDefinitionStatisticsQuery query = managementService.createProcessDefinitionStatisticsQuery();
assertThat(query.count(), is(3L));
Set<String> tenantIds = collectDefinitionTenantIds(query.list());
assertThat(tenantIds.size(), is(3));
assertThat(tenantIds, hasItems(null, TENANT_ONE, TENANT_TWO));
}
use of org.camunda.bpm.engine.management.ProcessDefinitionStatisticsQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyStatisticsQueryTest method testQueryAuthenticatedTenantForProcessDefinitionStatistics.
public void testQueryAuthenticatedTenantForProcessDefinitionStatistics() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
ProcessDefinitionStatisticsQuery query = managementService.createProcessDefinitionStatisticsQuery();
assertThat(query.count(), is(2L));
Set<String> tenantIds = collectDefinitionTenantIds(query.list());
assertThat(tenantIds.size(), is(2));
assertThat(tenantIds, hasItems(null, TENANT_ONE));
}
use of org.camunda.bpm.engine.management.ProcessDefinitionStatisticsQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionStatisticsAuthorizationTest method testQueryWithoutAuthorizations.
// without running instances //////////////////////////////////////////////////////////
public void testQueryWithoutAuthorizations() {
// given
// when
ProcessDefinitionStatisticsQuery query = managementService.createProcessDefinitionStatisticsQuery();
// then
verifyQueryResults(query, 0);
}
use of org.camunda.bpm.engine.management.ProcessDefinitionStatisticsQuery in project camunda-bpm-platform by camunda.
the class ProcessDefinitionStatisticsAuthorizationTest method testQueryWithReadPermissionOnAnyProcessDefinition.
public void testQueryWithReadPermissionOnAnyProcessDefinition() {
// given
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ);
// when
ProcessDefinitionStatisticsQuery query = managementService.createProcessDefinitionStatisticsQuery();
// then
verifyQueryResults(query, 2);
List<ProcessDefinitionStatistics> statistics = query.list();
for (ProcessDefinitionStatistics result : statistics) {
verifyStatisticsResult(result, 0, 0, 0);
}
}
Aggregations