Search in sources :

Example 31 with HistoricExternalTaskLogQuery

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

the class MultiTenancyHistoricExternalTaskLogTest method testQueryAuthenticatedTenant.

@Test
public void testQueryAuthenticatedTenant() {
    // given
    identityService.setAuthentication("user", null, Collections.singletonList(TENANT_ONE));
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    // then
    assertThat(query.count(), is(2L));
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(2L));
    assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
    assertThat(query.tenantIdIn(TENANT_ONE, TENANT_TWO).count(), is(2L));
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery) Test(org.junit.Test)

Example 32 with HistoricExternalTaskLogQuery

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

the class MultiTenancyHistoricExternalTaskLogTest method testQueryByTenantId.

@Test
public void testQueryByTenantId() {
    // given two process with different tenants
    // when
    HistoricExternalTaskLogQuery queryTenant1 = historyService.createHistoricExternalTaskLogQuery().tenantIdIn(TENANT_ONE);
    HistoricExternalTaskLogQuery queryTenant2 = historyService.createHistoricExternalTaskLogQuery().tenantIdIn(TENANT_TWO);
    // then
    assertThat(queryTenant1.count(), is(2L));
    assertThat(queryTenant2.count(), is(3L));
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery) Test(org.junit.Test)

Example 33 with HistoricExternalTaskLogQuery

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

the class MultiTenancyHistoricExternalTaskLogTest method testQueryByNonExistingTenantId.

@Test
public void testQueryByNonExistingTenantId() {
    // given two process with different tenants
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery().tenantIdIn("nonExisting");
    // then
    assertThat(query.count(), is(0L));
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery) Test(org.junit.Test)

Example 34 with HistoricExternalTaskLogQuery

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

the class HistoricExternalTaskLogQuerySortingTest method testQuerySortingByActivityIdAsc.

@Test
public void testQuerySortingByActivityIdAsc() {
    // given
    int taskCount = 10;
    startProcessesByActivityId(taskCount);
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    query.orderByActivityId().asc();
    // then
    verifyQueryWithOrdering(query, taskCount, historicExternalTaskLogByActivityId());
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery) Test(org.junit.Test)

Example 35 with HistoricExternalTaskLogQuery

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

the class HistoricExternalTaskLogQuerySortingTest method testQuerySortingByExecutionIdAsc.

@Test
public void testQuerySortingByExecutionIdAsc() {
    // given
    int taskCount = 10;
    startProcesses(taskCount);
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    query.orderByExecutionId().asc();
    // then
    verifyQueryWithOrdering(query, taskCount, historicExternalTaskLogByExecutionId());
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery) Test(org.junit.Test)

Aggregations

HistoricExternalTaskLogQuery (org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)44 Test (org.junit.Test)33 ExternalTask (org.camunda.bpm.engine.externaltask.ExternalTask)4 LockedExternalTask (org.camunda.bpm.engine.externaltask.LockedExternalTask)4 HistoricExternalTaskLog (org.camunda.bpm.engine.history.HistoricExternalTaskLog)2 ArrayList (java.util.ArrayList)1 AbstractRestServiceTest (org.camunda.bpm.engine.rest.AbstractRestServiceTest)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 HistoricExternalTaskLogDto (org.camunda.bpm.engine.rest.dto.history.HistoricExternalTaskLogDto)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1