@Test public void testReceivePayLoad() { final GlobalTransactionStepDefinition transactionPipeline = mock(GlobalTransactionStepDefinition.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)); innerGlobalTxStepVisitorUnderTest.receivePayLoad(transactionPipeline); verify(mockCommandOrchestrator).retreive("someid", Object.class); verify(target).accept(any()); }
void receivePayLoad(GlobalTransactionStepDefinition<? extends BaseGlobalTransactionEvent> transactionPipeline){ final AbstractTransactionStepDefinition.ReceivedCommand<Object> receivedCommand = transactionPipeline.getReceivedCommand(); if(receivedCommand != null) { Optional<Object> payload = getCommandOrchestrator().retreive(transactionPipeline.getIn().getId(), receivedCommand.getTarget()); payload.ifPresent(p -> receivedCommand.getConsumer().accept(p)); } }
InnerGlobalTxStepVisitor extends StepGlobalTxVisitor { void receivePayLoad(GlobalTransactionStepDefinition<? extends BaseGlobalTransactionEvent> transactionPipeline){ final AbstractTransactionStepDefinition.ReceivedCommand<Object> receivedCommand = transactionPipeline.getReceivedCommand(); if(receivedCommand != null) { Optional<Object> payload = getCommandOrchestrator().retreive(transactionPipeline.getIn().getId(), receivedCommand.getTarget()); payload.ifPresent(p -> receivedCommand.getConsumer().accept(p)); } } }
InnerGlobalTxStepVisitor extends StepGlobalTxVisitor { void receivePayLoad(GlobalTransactionStepDefinition<? extends BaseGlobalTransactionEvent> transactionPipeline){ final AbstractTransactionStepDefinition.ReceivedCommand<Object> receivedCommand = transactionPipeline.getReceivedCommand(); if(receivedCommand != null) { Optional<Object> payload = getCommandOrchestrator().retreive(transactionPipeline.getIn().getId(), receivedCommand.getTarget()); payload.ifPresent(p -> receivedCommand.getConsumer().accept(p)); } } InnerGlobalTxStepVisitor(BubbleCache bubbleCache, ApplicationEventPublisher applicationEventPublisher,
                                    VisitorProvision provision, CommandOrchestrator commandOrchestrator, TransactionUtilities utilities); }
InnerGlobalTxStepVisitor extends StepGlobalTxVisitor { void receivePayLoad(GlobalTransactionStepDefinition<? extends BaseGlobalTransactionEvent> transactionPipeline){ final AbstractTransactionStepDefinition.ReceivedCommand<Object> receivedCommand = transactionPipeline.getReceivedCommand(); if(receivedCommand != null) { Optional<Object> payload = getCommandOrchestrator().retreive(transactionPipeline.getIn().getId(), receivedCommand.getTarget()); payload.ifPresent(p -> receivedCommand.getConsumer().accept(p)); } } InnerGlobalTxStepVisitor(BubbleCache bubbleCache, ApplicationEventPublisher applicationEventPublisher,
                                    VisitorProvision provision, CommandOrchestrator commandOrchestrator, TransactionUtilities utilities); static InnerGlobalTxStepVisitorBuilder builder(); @Override void visit(GlobalTransactionStepDefinition<? extends BaseGlobalTransactionEvent> transactionPipeline); }
InnerGlobalTxStepVisitor extends StepGlobalTxVisitor { void receivePayLoad(GlobalTransactionStepDefinition<? extends BaseGlobalTransactionEvent> transactionPipeline){ final AbstractTransactionStepDefinition.ReceivedCommand<Object> receivedCommand = transactionPipeline.getReceivedCommand(); if(receivedCommand != null) { Optional<Object> payload = getCommandOrchestrator().retreive(transactionPipeline.getIn().getId(), receivedCommand.getTarget()); payload.ifPresent(p -> receivedCommand.getConsumer().accept(p)); } } InnerGlobalTxStepVisitor(BubbleCache bubbleCache, ApplicationEventPublisher applicationEventPublisher,
                                    VisitorProvision provision, CommandOrchestrator commandOrchestrator, TransactionUtilities utilities); static InnerGlobalTxStepVisitorBuilder builder(); @Override void visit(GlobalTransactionStepDefinition<? extends BaseGlobalTransactionEvent> transactionPipeline);  }