@SuppressWarnings("unchecked") @Test void testCorrelationDataIsAttachedToCommandAsObject() { UnitOfWork<CommandMessage<?>> unitOfWork = DefaultUnitOfWork.startAndGet(null); unitOfWork.registerCorrelationDataProvider(message -> Collections.singletonMap("correlationId", "test")); testSubject.send("Hello"); verify(mockCommandBus).dispatch(argThat(x -> "test".equals(x.getMetaData().get("correlationId"))), isA(CommandCallback.class)); CurrentUnitOfWork.clear(unitOfWork); }
@Override public <C, R> void send(C command, CommandCallback<? super C, ? super R> callback) { super.send(command, callback); }
DefaultCommandGateway extends AbstractCommandGateway implements CommandGateway { @Override public <C, R> void send(C command, CommandCallback<? super C, ? super R> callback) { super.send(command, callback); } }
DefaultCommandGateway extends AbstractCommandGateway implements CommandGateway { @Override public <C, R> void send(C command, CommandCallback<? super C, ? super R> callback) { super.send(command, callback); } protected  DefaultCommandGateway(Builder builder); }
DefaultCommandGateway extends AbstractCommandGateway implements CommandGateway { @Override public <C, R> void send(C command, CommandCallback<? super C, ? super R> callback) { super.send(command, callback); } protected  DefaultCommandGateway(Builder builder); static Builder builder(); @Override void send(C command, CommandCallback<? super C, ? super R> callback); @Override @SuppressWarnings("unchecked") R sendAndWait(Object command); @Override @SuppressWarnings("unchecked") R sendAndWait(Object command, long timeout, TimeUnit unit); @Override CompletableFuture<R> send(Object command); @Override Registration registerDispatchInterceptor(
            MessageDispatchInterceptor<? super CommandMessage<?>> dispatchInterceptor); }
DefaultCommandGateway extends AbstractCommandGateway implements CommandGateway { @Override public <C, R> void send(C command, CommandCallback<? super C, ? super R> callback) { super.send(command, callback); } protected  DefaultCommandGateway(Builder builder); static Builder builder(); @Override void send(C command, CommandCallback<? super C, ? super R> callback); @Override @SuppressWarnings("unchecked") R sendAndWait(Object command); @Override @SuppressWarnings("unchecked") R sendAndWait(Object command, long timeout, TimeUnit unit); @Override CompletableFuture<R> send(Object command); @Override Registration registerDispatchInterceptor(
            MessageDispatchInterceptor<? super CommandMessage<?>> dispatchInterceptor);  }