doThrow(new IllegalStateException("ksession")).when(runtimeEngineMock).getKieSession();
// - let disposeRuntimeEngine() happen.
doNothing().when(runtimeMgrMgrMock).disposeRuntimeEngine(any(RuntimeEngine.class));
// UserTaskService setup
UserTaskService userTaskServiceMock = mock(UserTaskService.class);
test.setUserTaskServiceMock(userTaskServiceMock);
// TaskService
InternalTaskService injectedTaskServiceMock = mock(InternalTaskService.class);