@SuppressWarnings("unchecked")
@Test(timeout = 10000)
public void testAggregatesBlacklistedAndRecoveredOnError_WithAutoReschedule() throws Throwable {
CommandHandlerInterceptor mockInterceptor = mock(CommandHandlerInterceptor.class);
ExecutorService customExecutor = Executors.newCachedThreadPool();
CommandCallback mockCallback = dispatchCommands(mockInterceptor,
customExecutor,
new GenericCommandMessage<ErrorCommand>(
new ErrorCommand(aggregateIdentifier))
);
assertFalse(customExecutor.awaitTermination(250, TimeUnit.MILLISECONDS));