Search in sources :

Example 6 with ProcessDefinitionStatisticsQuery

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));
}
Also used : ProcessDefinitionStatisticsQuery(org.camunda.bpm.engine.management.ProcessDefinitionStatisticsQuery)

Example 7 with ProcessDefinitionStatisticsQuery

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));
}
Also used : ProcessDefinitionStatisticsQuery(org.camunda.bpm.engine.management.ProcessDefinitionStatisticsQuery)

Example 8 with ProcessDefinitionStatisticsQuery

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);
}
Also used : ProcessDefinitionStatisticsQuery(org.camunda.bpm.engine.management.ProcessDefinitionStatisticsQuery)

Example 9 with ProcessDefinitionStatisticsQuery

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);
    }
}
Also used : ProcessDefinitionStatistics(org.camunda.bpm.engine.management.ProcessDefinitionStatistics) ProcessDefinitionStatisticsQuery(org.camunda.bpm.engine.management.ProcessDefinitionStatisticsQuery)

Aggregations

ProcessDefinitionStatisticsQuery (org.camunda.bpm.engine.management.ProcessDefinitionStatisticsQuery)9 ProcessDefinitionStatistics (org.camunda.bpm.engine.management.ProcessDefinitionStatistics)3 ArrayList (java.util.ArrayList)1 ManagementService (org.camunda.bpm.engine.ManagementService)1 StatisticsResultDto (org.camunda.bpm.engine.rest.dto.StatisticsResultDto)1 ProcessDefinitionStatisticsResultDto (org.camunda.bpm.engine.rest.dto.repository.ProcessDefinitionStatisticsResultDto)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1