verify(mockTransactionManager, times(3)).commitTransaction(any());
}
@Test
public void testEventProcessingDelayed_ScheduledExecutorService() {
EventMessage<? extends StubDomainEvent> event1 = new GenericEventMessage<StubDomainEvent>(new StubDomainEvent());
EventMessage<? extends StubDomainEvent> event2 = new GenericEventMessage<StubDomainEvent>(new StubDomainEvent());
final EventListener listener = mock(EventListener.class);
ScheduledExecutorService mockExecutorService = mock(ScheduledExecutorService.class);
testSubject = new EventProcessor(mockExecutorService, new NullShutdownCallback(),
new DefaultErrorHandler(RetryPolicy.retryAfter(500, TimeUnit.MILLISECONDS)),
new DefaultUnitOfWorkFactory(mockTransactionManager),