Search in sources :

Example 16 with HistoricExternalTaskLog

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

the class HistoricExternalTaskLogQueryTest method testQueryByNonExistingWorkerId.

@Test
public void testQueryByNonExistingWorkerId() {
    // given
    ExternalTask task = startExternalTaskProcess();
    completeExternalTask(task.getId());
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().workerId("foo").singleResult();
    // then
    assertNull(log);
}
Also used : HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog) ExternalTask(org.camunda.bpm.engine.externaltask.ExternalTask) LockedExternalTask(org.camunda.bpm.engine.externaltask.LockedExternalTask) Test(org.junit.Test)

Example 17 with HistoricExternalTaskLog

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

the class HistoricExternalTaskLogQueryTest method testQueryByNonExistingId.

@Test
public void testQueryByNonExistingId() {
    // given
    startExternalTaskProcess();
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().logId("foo").singleResult();
    // then
    assertNull(log);
}
Also used : HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog) Test(org.junit.Test)

Example 18 with HistoricExternalTaskLog

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

the class HistoricExternalTaskLogQueryTest method testQueryBySuccessLog.

@Test
public void testQueryBySuccessLog() {
    // given
    ExternalTask task = startExternalTaskProcess();
    completeExternalTask(task.getId());
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().successLog().singleResult();
    // then
    assertNotNull(log);
    assertThat(log.getExternalTaskId(), is(task.getId()));
}
Also used : HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog) ExternalTask(org.camunda.bpm.engine.externaltask.ExternalTask) LockedExternalTask(org.camunda.bpm.engine.externaltask.LockedExternalTask) Test(org.junit.Test)

Example 19 with HistoricExternalTaskLog

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

the class HistoricExternalTaskLogTest method testRetriesAndWorkerIdWhenFirstFailureAndThenComplete.

@Test
public void testRetriesAndWorkerIdWhenFirstFailureAndThenComplete() {
    // given
    ExternalTask task = startExternalTaskProcess();
    reportExternalTaskFailure(task.getId());
    completeExternalTask(task.getId());
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().successLog().singleResult();
    // then
    assertEquals(WORKER_ID, log.getWorkerId());
    assertEquals(Integer.valueOf(1), log.getRetries());
    assertLogIsInSuccessfulState(log);
}
Also used : HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog) ExternalTask(org.camunda.bpm.engine.externaltask.ExternalTask) Test(org.junit.Test)

Example 20 with HistoricExternalTaskLog

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

the class HistoricExternalTaskLogTest method testHistoricExternalTaskLogDeletedProperties.

@Test
public void testHistoricExternalTaskLogDeletedProperties() {
    // given
    ExternalTask task = startExternalTaskProcess();
    runtimeService.deleteProcessInstance(task.getProcessInstanceId(), "Dummy reason for deletion!");
    // when
    HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().deletionLog().singleResult();
    // then
    assertHistoricLogPropertiesAreProperlySet(task, log);
    assertEquals(null, log.getWorkerId());
    assertLogIsInDeletedState(log);
}
Also used : HistoricExternalTaskLog(org.camunda.bpm.engine.history.HistoricExternalTaskLog) ExternalTask(org.camunda.bpm.engine.externaltask.ExternalTask) Test(org.junit.Test)

Aggregations

HistoricExternalTaskLog (org.camunda.bpm.engine.history.HistoricExternalTaskLog)42 Test (org.junit.Test)37 ExternalTask (org.camunda.bpm.engine.externaltask.ExternalTask)19 LockedExternalTask (org.camunda.bpm.engine.externaltask.LockedExternalTask)12 HistoricExternalTaskLogQuery (org.camunda.bpm.engine.history.HistoricExternalTaskLogQuery)3 HistoryService (org.camunda.bpm.engine.HistoryService)2 ArrayList (java.util.ArrayList)1 HistoricExternalTaskLogDto (org.camunda.bpm.engine.rest.dto.history.HistoricExternalTaskLogDto)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1 Before (org.junit.Before)1