assertEquals(3, historyService.createHistoricVariableInstanceQuery().caseInstanceId(caseInstanceId).count());
assertEquals(3, historyService.createHistoricVariableInstanceQuery().caseExecutionIdIn(caseExecutionId, taskExecutionId).count());
assertEquals(2, historyService.createHistoricVariableInstanceQuery().caseExecutionIdIn(caseExecutionId).count());
assertEquals(1, historyService.createHistoricVariableInstanceQuery().caseExecutionIdIn(taskExecutionId).count());
HistoryLevel historyLevel = processEngineConfiguration.getHistoryLevel();
if (historyLevel.equals(HistoryLevel.HISTORY_LEVEL_FULL)) {
assertEquals(5, historyService.createHistoricDetailQuery().count());
assertEquals(5, historyService.createHistoricDetailQuery().caseInstanceId(caseInstanceId).count());
assertEquals(3, historyService.createHistoricDetailQuery().caseExecutionId(caseExecutionId).count());
assertEquals(2, historyService.createHistoricDetailQuery().caseExecutionId(taskExecutionId).count());
}