use of org.camunda.bpm.engine.history.HistoricExternalTaskLog 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);
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogResourceImpl method getHistoricExternalTaskLog.
@Override
public HistoricExternalTaskLogDto getHistoricExternalTaskLog() {
HistoryService historyService = engine.getHistoryService();
HistoricExternalTaskLog historicExternalTaskLog = historyService.createHistoricExternalTaskLogQuery().logId(id).singleResult();
if (historicExternalTaskLog == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Historic external task log with id " + id + " does not exist");
}
return HistoricExternalTaskLogDto.fromHistoricExternalTaskLog(historicExternalTaskLog);
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class MockProvider method createMockHistoricExternalTaskLog.
public static HistoricExternalTaskLog createMockHistoricExternalTaskLog(String tenantId) {
HistoricExternalTaskLog mock = mock(HistoricExternalTaskLog.class);
when(mock.getId()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_ID);
when(mock.getTimestamp()).thenReturn(DateTimeUtil.parseDate(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_TIMESTAMP));
when(mock.getExternalTaskId()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_EXTERNAL_TASK_ID);
when(mock.getTopicName()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_TOPIC_NAME);
when(mock.getWorkerId()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_WORKER_ID);
when(mock.getRetries()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_RETRIES);
when(mock.getPriority()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_PRIORITY);
when(mock.getErrorMessage()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_ERROR_MSG);
when(mock.getActivityId()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_ACTIVITY_ID);
when(mock.getActivityInstanceId()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_ACTIVITY_INSTANCE_ID);
when(mock.getExecutionId()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_EXECUTION_ID);
when(mock.getProcessInstanceId()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_PROC_INST_ID);
when(mock.getProcessDefinitionId()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_PROC_DEF_ID);
when(mock.getProcessDefinitionKey()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_PROC_DEF_KEY);
when(mock.getTenantId()).thenReturn(tenantId);
when(mock.isCreationLog()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_IS_CREATION_LOG);
when(mock.isFailureLog()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_IS_FAILURE_LOG);
when(mock.isSuccessLog()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_IS_SUCCESS_LOG);
when(mock.isDeletionLog()).thenReturn(EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_IS_DELETION_LOG);
return mock;
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQueryTest method testQueryByDeletionLog.
@Test
public void testQueryByDeletionLog() {
// given
ExternalTask task = startExternalTaskProcess();
runtimeService.deleteProcessInstance(task.getProcessInstanceId(), null);
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().deletionLog().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 HistoricExternalTaskLogQueryTest method testQuery.
@Test
public void testQuery() {
// given
ExternalTask task = startExternalTaskProcess();
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().singleResult();
// then
assertNotNull(log);
assertThat(log.getExternalTaskId(), is(task.getId()));
}
Aggregations