private MockEventListener executeEventProcessing(RetryPolicy policy) {
ExecutorService mockExecutorService = mock(ExecutorService.class);
final MockEventListener listener = new MockEventListener();
testSubject = new EventProcessor(mockExecutorService, new NullShutdownCallback(),
new DefaultErrorHandler(policy),
new DefaultUnitOfWorkFactory(mockTransactionManager),
Collections.<EventListener>singleton(listener),
multiplexingEventProcessingMonitor);
doNothing().doThrow(new RejectedExecutionException()).when(mockExecutorService).execute(isA(Runnable.class));
testSubject.scheduleEvent(new GenericEventMessage<StubDomainEvent>(new StubDomainEvent()));
listener.failOnEvent = 2;