taskService.complete(task.getId());
}
HistoricCaseActivityInstanceQuery query = historyService.createHistoricCaseActivityInstanceQuery();
HistoricCaseActivityInstance historicTask1 = query.caseInstanceId(oneTaskCaseId).caseActivityId(taskId1).singleResult();
HistoricCaseActivityInstance historicTask2 = query.caseInstanceId(twoTaskCaseId).caseActivityId(taskId1).singleResult();
HistoricCaseActivityInstance historicTask3 = query.caseInstanceId(twoTaskCaseId).caseActivityId(taskId2).singleResult();
// sort by create times
assertQuerySorting("createTime", historicQuery().orderByHistoricCaseActivityInstanceCreateTime(),
historicTask1.getCreateTime(), historicTask2.getCreateTime(), historicTask3.getCreateTime());