@SuppressWarnings("unchecked") @Test void testDispatchWithoutCallback() throws Exception { MessageHandler<CommandMessage<?>> commandHandler = mock(MessageHandler.class); testSubject.subscribe(Object.class.getName(), commandHandler); testSubject.dispatch(asCommandMessage(new Object()), NoOpCallback.INSTANCE); InOrder inOrder = inOrder(executorService, commandHandler, dispatchInterceptor, handlerInterceptor); inOrder.verify(dispatchInterceptor).handle(isA(CommandMessage.class)); inOrder.verify(executorService).execute(isA(Runnable.class)); inOrder.verify(handlerInterceptor).handle(isA(UnitOfWork.class), isA(InterceptorChain.class)); inOrder.verify(commandHandler).handle(isA(CommandMessage.class)); }
@Override protected <C, R> void handle(CommandMessage<C> command, MessageHandler<? super CommandMessage<?>> handler, CommandCallback<? super C, ? super R> callback) { executor.execute(() -> super.handle(command, handler, callback)); }
AsynchronousCommandBus extends SimpleCommandBus { @Override protected <C, R> void handle(CommandMessage<C> command, MessageHandler<? super CommandMessage<?>> handler, CommandCallback<? super C, ? super R> callback) { executor.execute(() -> super.handle(command, handler, callback)); } }
AsynchronousCommandBus extends SimpleCommandBus { @Override protected <C, R> void handle(CommandMessage<C> command, MessageHandler<? super CommandMessage<?>> handler, CommandCallback<? super C, ? super R> callback) { executor.execute(() -> super.handle(command, handler, callback)); } protected  AsynchronousCommandBus(Builder builder); }
AsynchronousCommandBus extends SimpleCommandBus { @Override protected <C, R> void handle(CommandMessage<C> command, MessageHandler<? super CommandMessage<?>> handler, CommandCallback<? super C, ? super R> callback) { executor.execute(() -> super.handle(command, handler, callback)); } protected  AsynchronousCommandBus(Builder builder); static Builder builder(); void shutdown(); }
AsynchronousCommandBus extends SimpleCommandBus { @Override protected <C, R> void handle(CommandMessage<C> command, MessageHandler<? super CommandMessage<?>> handler, CommandCallback<? super C, ? super R> callback) { executor.execute(() -> super.handle(command, handler, callback)); } protected  AsynchronousCommandBus(Builder builder); static Builder builder(); void shutdown();  }