assertEquals("Service Task", historyActivities.get(1).getActivityName());
Task task = activitiRule.getTaskService().createTaskQuery().taskAssignee("kermit").singleResult();
variables.put("approved", Boolean.FALSE);
variables.put("comments", "No, we will not publish this on Twitter");
variables.put("binary", new HashMap<String, Serializable>());
activitiRule.getTaskService().complete(task.getId(), variables);
TestHelper.assertProcessEnded(activitiRule.getProcessEngine(), id);
HistoricProcessInstance historicProcessInstance = activitiRule.getHistoryService().createHistoricProcessInstanceQuery().processInstanceId(id).singleResult();
assertNotNull(historicProcessInstance);