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);
}
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);
}
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()));
}
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);
}
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);
}
Aggregations