Search in sources :

Example 1 with HistoricExternalTaskLogQuery

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

the class ProcessEngineRestServiceTest method createHistoricExternalTaskLogMock.

private void createHistoricExternalTaskLogMock() {
    HistoricExternalTaskLogQuery mockHistoricExternalTaskLogQuery = mock(HistoricExternalTaskLogQuery.class);
    List<HistoricExternalTaskLog> historicExternalTaskLogs = MockProvider.createMockHistoricExternalTaskLogs();
    when(mockHistoricExternalTaskLogQuery.list()).thenReturn(historicExternalTaskLogs);
    when(mockHistoryService.createHistoricExternalTaskLogQuery()).thenReturn(mockHistoricExternalTaskLogQuery);
}
Also used : HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog) HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)

Example 2 with HistoricExternalTaskLogQuery

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

the class HistoricExternalTaskLogRestServiceQueryTest method setUpMockHistoricExternalTaskLogQuery.

protected HistoricExternalTaskLogQuery setUpMockHistoricExternalTaskLogQuery(List<HistoricExternalTaskLog> mockedHistoricExternalTaskLogs) {
    HistoricExternalTaskLogQuery mockedHistoricExternalTaskLogQuery = mock(HistoricExternalTaskLogQuery.class);
    when(mockedHistoricExternalTaskLogQuery.list()).thenReturn(mockedHistoricExternalTaskLogs);
    when(mockedHistoricExternalTaskLogQuery.count()).thenReturn((long) mockedHistoricExternalTaskLogs.size());
    when(processEngine.getHistoryService().createHistoricExternalTaskLogQuery()).thenReturn(mockedHistoricExternalTaskLogQuery);
    return mockedHistoricExternalTaskLogQuery;
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)

Example 3 with HistoricExternalTaskLogQuery

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

the class MultiTenancyHistoricExternalTaskLogTest method testQueryByTenantIds.

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

Example 4 with HistoricExternalTaskLogQuery

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

the class MultiTenancyHistoricExternalTaskLogTest method testQueryWithoutTenantId.

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

Example 5 with HistoricExternalTaskLogQuery

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

the class HistoricExternalTaskLogAuthorizationTest method testQueryWithoutAuthorization.

public void testQueryWithoutAuthorization() {
    // given
    startThreeProcessInstancesDeleteOneAndCompleteTwoWithFailure();
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    // then
    verifyQueryResults(query, 0);
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)

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