Search in sources :

Example 26 with HistoricExternalTaskLogQuery

use of org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery in project camunda-bpm-platform by camunda.

the class HistoricExternalTaskLogAuthorizationTest method testQueryWithHistoryReadPermissionOnAnyProcessDefinition.

public void testQueryWithHistoryReadPermissionOnAnyProcessDefinition() {
    // given
    startThreeProcessInstancesDeleteOneAndCompleteTwoWithFailure();
    createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    // then
    verifyQueryResults(query, 8);
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)

Example 27 with HistoricExternalTaskLogQuery

use of org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery in project camunda-bpm-platform by camunda.

the class HistoricExternalTaskLogAuthorizationTest method testQueryWithHistoryReadPermissionOnOneProcessDefinition.

public void testQueryWithHistoryReadPermissionOnOneProcessDefinition() {
    // given
    startThreeProcessInstancesDeleteOneAndCompleteTwoWithFailure();
    createGrantAuthorization(PROCESS_DEFINITION, DEFAULT_PROCESS_KEY, userId, READ_HISTORY);
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    // then
    verifyQueryResults(query, 6);
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)

Example 28 with HistoricExternalTaskLogQuery

use of org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyHistoricExternalTaskLogTest method testQueryNoAuthenticatedTenants.

@Test
public void testQueryNoAuthenticatedTenants() {
    // given
    identityService.setAuthentication("user", null, null);
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    // then
    assertThat(query.count(), is(0L));
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery) Test(org.junit.Test)

Example 29 with HistoricExternalTaskLogQuery

use of org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyHistoricExternalTaskLogTest method testQueryAuthenticatedTenants.

@Test
public void testQueryAuthenticatedTenants() {
    // given
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    // then
    assertThat(query.count(), is(5L));
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(2L));
    assertThat(query.tenantIdIn(TENANT_TWO).count(), is(3L));
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery) Test(org.junit.Test)

Example 30 with HistoricExternalTaskLogQuery

use of org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyHistoricExternalTaskLogTest method testQueryDisabledTenantCheck.

@Test
public void testQueryDisabledTenantCheck() {
    // given
    engineRule.getProcessEngineConfiguration().setTenantCheckEnabled(false);
    identityService.setAuthentication("user", null, null);
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    // then
    assertThat(query.count(), is(5L));
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery) Test(org.junit.Test)

Aggregations

HistoricExternalTaskLogQuery (org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)44 Test (org.junit.Test)33 ExternalTask (org.camunda.bpm.engine.externaltask.ExternalTask)4 LockedExternalTask (org.camunda.bpm.engine.externaltask.LockedExternalTask)4 HistoricExternalTaskLog (org.camunda.bpm.engine.history.HistoricExternalTaskLog)2 ArrayList (java.util.ArrayList)1 AbstractRestServiceTest (org.camunda.bpm.engine.rest.AbstractRestServiceTest)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 HistoricExternalTaskLogDto (org.camunda.bpm.engine.rest.dto.history.HistoricExternalTaskLogDto)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1