InnerLocalTxStepVisitor extends StepLocalTxVisitor { void receivePayLoad(LocalTransactionStepDefinition<? extends BaseLocalTransactionEvent> transactionPipeline) { if (transactionPipeline.getReceivedCommand() != null) { Optional<Object> payload = getCommandOrchestrator().retreive(transactionPipeline.getIn().getId(), transactionPipeline.getReceivedCommand().getTarget()); payload.ifPresent(p -> transactionPipeline.getReceivedCommand().getConsumer().accept(p)); } } InnerLocalTxStepVisitor(BubbleCache bubbleCache, ApplicationEventPublisher applicationEventPublisher,
			VisitorProvision provision, CommandOrchestrator commandOrchestrator, TransactionUtilities utilities); static InnerLocalTxStepVisitorBuilder builder(); @Override void visit(LocalTransactionStepDefinition<? extends BaseLocalTransactionEvent> transactionPipeline);  }
@Test public void testReceivePayLoad() { final LocalTransactionStepDefinition transactionPipeline = mock(LocalTransactionStepDefinition.class, RETURNS_DEEP_STUBS); final Consumer target = mock(Consumer.class); final String payload = "payload"; AbstractTransactionStepDefinition.ReceivedCommand command = new AbstractTransactionStepDefinition.ReceivedCommand(Object.class, target); when(transactionPipeline.getReceivedCommand()).thenReturn(command); when(transactionPipeline.getIn().getId()).thenReturn("someid"); when(mockCommandOrchestrator.retreive(anyString(), any())).thenReturn(Optional.of(payload)); innerLocalTxStepVisitorUnderTest.receivePayLoad(transactionPipeline); verify(mockCommandOrchestrator).retreive("someid", Object.class); verify(target).accept(any()); }