@Test
public void testReceivePayLoad() {

    // Setup
    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));
    // Run the test
    innerGlobalTxStepVisitorUnderTest.receivePayLoad(transactionPipeline);
    // Verify the results
    verify(mockCommandOrchestrator).retreive("someid", Object.class);
    verify(target).accept(any());
}