Search in sources :

Example 46 with HistoricDetailQuery

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

the class MultiTenancyHistoricDetailVariableUpdateQueryTest method testQueryNoAuthenticatedTenants.

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

Example 47 with HistoricDetailQuery

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

the class MultiTenancyHistoricDetailVariableUpdateQueryTest method testQueryByTenantId.

public void testQueryByTenantId() {
    HistoricDetailQuery query = historyService.createHistoricDetailQuery().variableUpdates().tenantIdIn(TENANT_ONE);
    assertThat(query.count(), is(2L));
    query = historyService.createHistoricDetailQuery().variableUpdates().tenantIdIn(TENANT_TWO);
    assertThat(query.count(), is(2L));
}
Also used : HistoricDetailQuery(org.camunda.bpm.engine.history.HistoricDetailQuery)

Example 48 with HistoricDetailQuery

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

the class HistoricDetailQueryTest method testQueryByInvalidExecutionId.

@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" })
public void testQueryByInvalidExecutionId() {
    startProcessInstance(PROCESS_KEY);
    String taskId = taskService.createTaskQuery().singleResult().getId();
    // when
    taskService.resolveTask(taskId, getVariables());
    // then
    HistoricDetailQuery query = historyService.createHistoricDetailQuery().executionId("invalid");
    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
}
Also used : HistoricDetailQuery(org.camunda.bpm.engine.history.HistoricDetailQuery) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 49 with HistoricDetailQuery

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

the class HistoricDetailQueryTest method testQueryByInvalidUserOperationId.

@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" })
public void testQueryByInvalidUserOperationId() {
    startProcessInstance(PROCESS_KEY);
    String taskId = taskService.createTaskQuery().singleResult().getId();
    // when
    taskService.resolveTask(taskId, getVariables());
    // then
    HistoricDetailQuery query = historyService.createHistoricDetailQuery().userOperationId("invalid");
    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
    try {
        query.userOperationId(null);
        fail("It was possible to set a null value as userOperationId.");
    } catch (ProcessEngineException e) {
    }
}
Also used : HistoricDetailQuery(org.camunda.bpm.engine.history.HistoricDetailQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

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