Search in sources :

Example 6 with HistoricExternalTaskLogQuery

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

the class HistoricExternalTaskLogAuthorizationTest method testSimpleQueryWithHistoryReadPermissionOnProcessDefinition.

public void testSimpleQueryWithHistoryReadPermissionOnProcessDefinition() {
    // given
    startProcessInstanceByKey(DEFAULT_PROCESS_KEY);
    createGrantAuthorization(PROCESS_DEFINITION, DEFAULT_PROCESS_KEY, userId, READ_HISTORY);
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    // then
    verifyQueryResults(query, 1);
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)

Example 7 with HistoricExternalTaskLogQuery

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

the class HistoricExternalTaskLogAuthorizationTest method testSimpleQueryWithHistoryReadPermissionOnAnyProcessDefinition.

public void testSimpleQueryWithHistoryReadPermissionOnAnyProcessDefinition() {
    // given
    startProcessInstanceByKey(DEFAULT_PROCESS_KEY);
    createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    // then
    verifyQueryResults(query, 1);
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)

Example 8 with HistoricExternalTaskLogQuery

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

the class HistoricExternalTaskLogAuthorizationTest method testSimpleQueryWithMultipleAuthorizations.

public void testSimpleQueryWithMultipleAuthorizations() {
    // given
    startProcessInstanceByKey(DEFAULT_PROCESS_KEY);
    createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
    createGrantAuthorization(PROCESS_DEFINITION, DEFAULT_PROCESS_KEY, userId, READ_HISTORY);
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    // then
    verifyQueryResults(query, 1);
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)

Example 9 with HistoricExternalTaskLogQuery

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

the class HistoricExternalTaskLogAuthorizationTest method testSimpleQueryWithoutAuthorization.

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

Example 10 with HistoricExternalTaskLogQuery

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

the class HistoricExternalTaskLogQuerySortingTest method testQuerySortingByRetriesDsc.

@Test
public void testQuerySortingByRetriesDsc() {
    // given
    int taskCount = 10;
    List<ExternalTask> list = startProcesses(taskCount);
    reportExternalTaskFailure(list);
    // when
    HistoricExternalTaskLogQuery query = historyService.createHistoricExternalTaskLogQuery();
    query.failureLog().orderByRetries().desc();
    // then
    verifyQueryWithOrdering(query, taskCount, inverted(historicExternalTaskLogByRetries()));
}
Also used : HistoricExternalTaskLogQuery(org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery) ExternalTask(org.camunda.bpm.engine.externaltask.ExternalTask) LockedExternalTask(org.camunda.bpm.engine.externaltask.LockedExternalTask) 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