Search in sources :

Example 16 with HistoricCaseActivityInstanceQuery

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

the class MultiTenancyHistoricCaseActivityInstanceQueryTest method testQueryAuthenticatedTenants.

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

Example 17 with HistoricCaseActivityInstanceQuery

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

the class MultiTenancyHistoricCaseActivityInstanceQueryTest method testQueryWithoutTenantId.

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

Example 18 with HistoricCaseActivityInstanceQuery

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

the class HistoricCaseActivityInstanceTest method testRepeatMilestone.

@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/repetition/RepetitionRuleTest.testRepeatMilestone.cmmn" })
public void testRepeatMilestone() {
    // given
    createCaseInstance();
    String firstHumanTaskId = queryCaseExecutionByActivityId("PI_HumanTask_1").getId();
    // when
    complete(firstHumanTaskId);
    // then
    HistoricCaseActivityInstanceQuery query = historicQuery().caseActivityId("PI_Milestone_1");
    assertEquals(2, query.count());
}
Also used : HistoricCaseActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 19 with HistoricCaseActivityInstanceQuery

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

the class HistoricCaseActivityInstanceTest method testRepeatTask.

@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/repetition/RepetitionRuleTest.testRepeatTask.cmmn" })
public void testRepeatTask() {
    // given
    createCaseInstance();
    String firstHumanTaskId = queryCaseExecutionByActivityId("PI_HumanTask_1").getId();
    // when
    complete(firstHumanTaskId);
    // then
    HistoricCaseActivityInstanceQuery query = historicQuery().caseActivityId("PI_HumanTask_2");
    assertEquals(2, query.count());
}
Also used : HistoricCaseActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 20 with HistoricCaseActivityInstanceQuery

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

the class HistoricCaseActivityInstanceTest method testRepeatStage.

@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/repetition/RepetitionRuleTest.testRepeatStage.cmmn" })
public void testRepeatStage() {
    // given
    createCaseInstance();
    String firstHumanTaskId = queryCaseExecutionByActivityId("PI_HumanTask_1").getId();
    // when
    complete(firstHumanTaskId);
    // then
    HistoricCaseActivityInstanceQuery query = historicQuery().caseActivityId("PI_Stage_1");
    assertEquals(2, query.count());
}
Also used : HistoricCaseActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

HistoricCaseActivityInstanceQuery (org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery)25 Deployment (org.camunda.bpm.engine.test.Deployment)11 HistoricCaseActivityInstance (org.camunda.bpm.engine.history.HistoricCaseActivityInstance)5 NotValidException (org.camunda.bpm.engine.exception.NotValidException)2 HistoricCaseInstance (org.camunda.bpm.engine.history.HistoricCaseInstance)2 Response (com.jayway.restassured.response.Response)1 ArrayList (java.util.ArrayList)1 AbstractRestServiceTest (org.camunda.bpm.engine.rest.AbstractRestServiceTest)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 HistoricCaseActivityInstanceDto (org.camunda.bpm.engine.rest.dto.history.HistoricCaseActivityInstanceDto)1 CaseExecution (org.camunda.bpm.engine.runtime.CaseExecution)1 CaseInstance (org.camunda.bpm.engine.runtime.CaseInstance)1 Task (org.camunda.bpm.engine.task.Task)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 Test (org.junit.Test)1 InOrder (org.mockito.InOrder)1