EventMessage<? extends StubDomainEvent> event2 = new GenericEventMessage<StubDomainEvent>(new StubDomainEvent());
final EventListener listener = mock(EventListener.class);
ExecutorService mockExecutorService = mock(ExecutorService.class);
testSubject = new EventProcessor(mockExecutorService, new NullShutdownCallback(),
new DefaultErrorHandler(RetryPolicy.retryAfter(500, TimeUnit.MILLISECONDS)),
new DefaultUnitOfWorkFactory(mockTransactionManager),
Collections.singleton(listener), multiplexingEventProcessingMonitor);
doThrow(new MockException()).doNothing().when(listener).handle(event1);
testSubject.scheduleEvent(event1);
testSubject.scheduleEvent(event2);
long t1 = System.currentTimeMillis();