Map<String, Object> variables = new HashMap<String, Object>();
variables.put("onePlusOneBean", new OnePlusOneBean());
runtimeService.startProcessInstanceByKey("testProcess", variables);
Execution execution = runtimeService.createExecutionQuery().activityId("wait").singleResult();
VariableInstance variable = runtimeService.createVariableInstanceQuery().variableName("var1").singleResult();
assertNotNull(variable);
assertEquals(2, variable.getValue());
assertEquals(execution.getId(), variable.getExecutionId());
}