Search in sources :

Example 6 with HistoricCaseInstanceQuery

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

the class MultiTenancyHistoricCaseInstanceQueryTest method testQueryByTenantId.

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

Example 7 with HistoricCaseInstanceQuery

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

the class MultiTenancyHistoricCaseInstanceQueryTest method testQueryAuthenticatedTenant.

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

Example 8 with HistoricCaseInstanceQuery

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

the class MultiTenancyHistoricCaseInstanceQueryTest method testQueryByTenantIds.

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

Example 9 with HistoricCaseInstanceQuery

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

the class MultiTenancyHistoricCaseInstanceQueryTest method testQueryByInstancesWithoutTenantId.

public void testQueryByInstancesWithoutTenantId() {
    HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().withoutTenantId();
    assertThat(query.count(), is(1L));
}
Also used : HistoricCaseInstanceQuery(org.camunda.bpm.engine.history.HistoricCaseInstanceQuery)

Example 10 with HistoricCaseInstanceQuery

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

the class MultiTenancyHistoricCaseInstanceQueryTest method testQueryDisabledTenantCheck.

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

Aggregations

HistoricCaseInstanceQuery (org.camunda.bpm.engine.history.HistoricCaseInstanceQuery)26 HistoricCaseInstance (org.camunda.bpm.engine.history.HistoricCaseInstance)7 Deployment (org.camunda.bpm.engine.test.Deployment)7 Response (com.jayway.restassured.response.Response)2 AbstractRestServiceTest (org.camunda.bpm.engine.rest.AbstractRestServiceTest)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 Test (org.junit.Test)2 InOrder (org.mockito.InOrder)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 HistoricCaseInstanceDto (org.camunda.bpm.engine.rest.dto.history.HistoricCaseInstanceDto)1