@SuppressWarnings("unchecked") @Test void testDispatchCommandNoHandlerSubscribed() { CommandMessage<Object> command = asCommandMessage("test"); CommandCallback callback = mock(CommandCallback.class); testSubject.dispatch(command, callback); ArgumentCaptor<CommandResultMessage> commandResultMessageCaptor = ArgumentCaptor.forClass(CommandResultMessage.class); verify(callback).onResult(eq(command), commandResultMessageCaptor.capture()); assertTrue(commandResultMessageCaptor.getValue().isExceptional()); assertEquals(NoHandlerForCommandException.class, commandResultMessageCaptor.getValue().exceptionResult().getClass()); }
@Override public <C> void dispatch(CommandMessage<C> command) { dispatch(command, defaultCommandCallback); }
SimpleCommandBus implements CommandBus { @Override public <C> void dispatch(CommandMessage<C> command) { dispatch(command, defaultCommandCallback); } }
SimpleCommandBus implements CommandBus { @Override public <C> void dispatch(CommandMessage<C> command) { dispatch(command, defaultCommandCallback); } protected  SimpleCommandBus(Builder builder); }
SimpleCommandBus implements CommandBus { @Override public <C> void dispatch(CommandMessage<C> command) { dispatch(command, defaultCommandCallback); } protected  SimpleCommandBus(Builder builder); static Builder builder(); @Override void dispatch(CommandMessage<C> command); @Override void dispatch(CommandMessage<C> command, final CommandCallback<? super C, ? super R> callback); @Override Registration subscribe(String commandName, MessageHandler<? super CommandMessage<?>> handler); @Override Registration registerHandlerInterceptor(
            MessageHandlerInterceptor<? super CommandMessage<?>> handlerInterceptor); @Override Registration registerDispatchInterceptor(
            MessageDispatchInterceptor<? super CommandMessage<?>> dispatchInterceptor); void setRollbackConfiguration(RollbackConfiguration rollbackConfiguration); }
SimpleCommandBus implements CommandBus { @Override public <C> void dispatch(CommandMessage<C> command) { dispatch(command, defaultCommandCallback); } protected  SimpleCommandBus(Builder builder); static Builder builder(); @Override void dispatch(CommandMessage<C> command); @Override void dispatch(CommandMessage<C> command, final CommandCallback<? super C, ? super R> callback); @Override Registration subscribe(String commandName, MessageHandler<? super CommandMessage<?>> handler); @Override Registration registerHandlerInterceptor(
            MessageHandlerInterceptor<? super CommandMessage<?>> handlerInterceptor); @Override Registration registerDispatchInterceptor(
            MessageDispatchInterceptor<? super CommandMessage<?>> dispatchInterceptor); void setRollbackConfiguration(RollbackConfiguration rollbackConfiguration);  }