Search in sources :

Example 36 with HistoricActivityInstanceQuery

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

the class HistoricActivityInstanceAuthorizationTest method testSimpleQueryWithoutAuthorization.

// historic activity instance query /////////////////////////////////
public void testSimpleQueryWithoutAuthorization() {
    // given
    startProcessInstanceByKey(PROCESS_KEY);
    // when
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
    // then
    verifyQueryResults(query, 0);
}
Also used : HistoricActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricActivityInstanceQuery)

Example 37 with HistoricActivityInstanceQuery

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

the class HistoricActivityInstanceAuthorizationTest method testSimpleQueryWithReadHistoryPermissionOnAnyProcessDefinition.

public void testSimpleQueryWithReadHistoryPermissionOnAnyProcessDefinition() {
    // given
    startProcessInstanceByKey(PROCESS_KEY);
    createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
    // when
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
    // then
    verifyQueryResults(query, 2);
}
Also used : HistoricActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricActivityInstanceQuery)

Example 38 with HistoricActivityInstanceQuery

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

the class MultiTenancyHistoricActivityInstanceQueryTest method testQueryDisabledTenantCheck.

public void testQueryDisabledTenantCheck() {
    processEngineConfiguration.setTenantCheckEnabled(false);
    identityService.setAuthentication("user", null, null);
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
    assertThat(query.count(), is(4L));
}
Also used : HistoricActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricActivityInstanceQuery)

Example 39 with HistoricActivityInstanceQuery

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

the class MultiTenancyHistoricActivityInstanceQueryTest method testQueryWithoutTenantId.

public void testQueryWithoutTenantId() {
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery();
    assertThat(query.count(), is(4L));
}
Also used : HistoricActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricActivityInstanceQuery)

Example 40 with HistoricActivityInstanceQuery

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

the class MultiTenancyHistoricActivityInstanceQueryTest method testQueryByNonExistingTenantId.

public void testQueryByNonExistingTenantId() {
    HistoricActivityInstanceQuery query = historyService.createHistoricActivityInstanceQuery().tenantIdIn("nonExisting");
    assertThat(query.count(), is(0L));
}
Also used : HistoricActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricActivityInstanceQuery)

Aggregations

HistoricActivityInstanceQuery (org.camunda.bpm.engine.history.HistoricActivityInstanceQuery)59 Deployment (org.camunda.bpm.engine.test.Deployment)35 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)18 Task (org.camunda.bpm.engine.task.Task)18 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)17 HistoricActivityInstance (org.camunda.bpm.engine.history.HistoricActivityInstance)13 Execution (org.camunda.bpm.engine.runtime.Execution)4 Test (org.junit.Test)4 Job (org.camunda.bpm.engine.runtime.Job)3 JobQuery (org.camunda.bpm.engine.runtime.JobQuery)3 TaskQuery (org.camunda.bpm.engine.task.TaskQuery)3 Response (com.jayway.restassured.response.Response)2 ArrayList (java.util.ArrayList)2 AbstractRestServiceTest (org.camunda.bpm.engine.rest.AbstractRestServiceTest)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 InOrder (org.mockito.InOrder)2 HashMap (java.util.HashMap)1 HistoricDetail (org.camunda.bpm.engine.history.HistoricDetail)1 HistoricVariableInstance (org.camunda.bpm.engine.history.HistoricVariableInstance)1 MigrationPlan (org.camunda.bpm.engine.migration.MigrationPlan)1