Search in sources :

Example 36 with HistoricDetailQuery

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

the class HistoricDetailAuthorizationTest method testSimpleVariableUpdateQueryWithoutAuthorization.

// historic variable update query (process task) /////////////////////////////////////////////
public void testSimpleVariableUpdateQueryWithoutAuthorization() {
    // given
    startProcessInstanceByKey(PROCESS_KEY, getVariables());
    // when
    HistoricDetailQuery query = historyService.createHistoricDetailQuery().variableUpdates();
    // then
    verifyQueryResults(query, 0);
}
Also used : HistoricDetailQuery(org.camunda.bpm.engine.history.HistoricDetailQuery)

Example 37 with HistoricDetailQuery

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

the class HistoricDetailAuthorizationTest method testDetailQueryWithReadHistoryOnProcessDefinition.

public void testDetailQueryWithReadHistoryOnProcessDefinition() {
    // given
    startProcessInstanceByKey(PROCESS_KEY);
    String taskId = selectSingleTask().getId();
    disableAuthorization();
    formService.submitTaskForm(taskId, getVariables());
    enableAuthorization();
    startProcessInstanceByKey(PROCESS_KEY);
    taskId = selectSingleTask().getId();
    disableAuthorization();
    formService.submitTaskForm(taskId, getVariables());
    enableAuthorization();
    startProcessInstanceByKey(PROCESS_KEY, getVariables());
    startProcessInstanceByKey(PROCESS_KEY, getVariables());
    startProcessInstanceByKey(PROCESS_KEY, getVariables());
    createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, READ_HISTORY);
    // when
    HistoricDetailQuery query = historyService.createHistoricDetailQuery();
    // then
    verifyQueryResults(query, 7);
}
Also used : HistoricDetailQuery(org.camunda.bpm.engine.history.HistoricDetailQuery)

Example 38 with HistoricDetailQuery

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

the class MultiTenancyHistoricDetailFormPropertyQueryTest method testQueryAuthenticatedTenants.

public void testQueryAuthenticatedTenants() {
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
    HistoricDetailQuery query = historyService.createHistoricDetailQuery();
    assertThat(query.count(), is(4L));
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(2L));
    assertThat(query.tenantIdIn(TENANT_TWO).count(), is(2L));
}
Also used : HistoricDetailQuery(org.camunda.bpm.engine.history.HistoricDetailQuery)

Example 39 with HistoricDetailQuery

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

the class MultiTenancyHistoricDetailFormPropertyQueryTest method testQueryDisabledTenantCheck.

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

Example 40 with HistoricDetailQuery

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

the class MultiTenancyHistoricDetailFormPropertyQueryTest method testQueryByNonExistingTenantId.

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

Aggregations

HistoricDetailQuery (org.camunda.bpm.engine.history.HistoricDetailQuery)49 Test (org.junit.Test)7 Deployment (org.camunda.bpm.engine.test.Deployment)5 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2 HistoricDetail (org.camunda.bpm.engine.history.HistoricDetail)2 HistoricDetailQueryDto (org.camunda.bpm.engine.rest.dto.history.HistoricDetailQueryDto)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)1 HistoricVariableInstance (org.camunda.bpm.engine.history.HistoricVariableInstance)1 HistoricVariableUpdate (org.camunda.bpm.engine.history.HistoricVariableUpdate)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 HistoricDetailDto (org.camunda.bpm.engine.rest.dto.history.HistoricDetailDto)1 Task (org.camunda.bpm.engine.task.Task)1 FileValue (org.camunda.bpm.engine.variable.value.FileValue)1 Ignore (org.junit.Ignore)1 Matchers.anyString (org.mockito.Matchers.anyString)1