caseService
.withCaseExecution(processTaskId)
.manualStart();
// then
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
query.caseInstanceId(caseInstanceId);
assertEquals(2, query.count());
assertEquals(2, query.list().size());
for (HistoricTaskInstance task : query.list()) {
assertEquals(caseInstanceId, task.getCaseInstanceId());
assertNull(task.getCaseDefinitionId());
assertNull(task.getCaseExecutionId());
taskService.complete(task.getId());
}
assertEquals(3, query.count());
assertEquals(3, query.list().size());
for (HistoricTaskInstance task : query.list()) {
assertEquals(caseInstanceId, task.getCaseInstanceId());
assertNull(task.getCaseDefinitionId());
assertNull(task.getCaseExecutionId());
}