ActivityImpl activityImpl = new ActivityImpl("test", null);
activityImpl.getExecutionListeners().put("start", Collections.<ExecutionListener>singletonList(new TestExecutionListener()));
execution.setActivity(activityImpl);
ProcessDefinitionImpl processDefinitionImpl = new ProcessDefinitionImpl("test");
processDefinitionImpl.getExecutionListeners().put("start", Collections.<ExecutionListener>singletonList(new TestExecutionListener()));
execution.setProcessDefinition(processDefinitionImpl);
TransitionImpl transitionImpl = new TransitionImpl("test", new ProcessDefinitionImpl("test"));
transitionImpl.addExecutionListener(new TestExecutionListener());
execution.setTransition(transitionImpl);
execution.setTransitionBeingTaken(transitionImpl);
execution.getProcessInstanceStartContext().setInitial(activityImpl);