@Test
public void testVisit() {

    // Setup
    final LocalTransactionStepDefinition transactionPipeline = mock(LocalTransactionStepDefinition.class);
    final String gtx = "gtx";
    final Supplier proccessSupplier = mock(Supplier.class);
    final LocalTransaction transaction = mock(LocalTransaction.class, RETURNS_DEEP_STUBS);
    final Consumer attach = mock(Consumer.class);
    final BaseTransactionCommand send = mock(BaseTransactionCommand.class);
    when(mockProvision.getLocalTransaction()).thenReturn(transaction);
    when(transaction.getGlobalTransaction().getId()).thenReturn(gtx);
    when(transactionPipeline.getProcess()).thenReturn(Optional.of(proccessSupplier));
    when(send.getId()).thenReturn("send");
    when(transactionPipeline.getSend()).thenReturn(Stream.of(send));
    when(transactionPipeline.getAttach()).thenReturn(Optional.of(attach));
    doNothing().when(innerLocalTxStepVisitorUnderTest).receivePayLoad(transactionPipeline);
    doNothing().when(innerLocalTxStepVisitorUnderTest).receivePayLoadGTX(transactionPipeline, gtx);
    // Run the test
    innerLocalTxStepVisitorUnderTest.visit(transactionPipeline);
    // Verify the results
    verify(proccessSupplier).get();
    verify(mockBubbleCache).addBubble(same("send"), any(BubbleMessage.class));
    verify(mockCommandOrchestrator).receive(send);
    verify(attach).accept(gtx);
    verify(innerLocalTxStepVisitorUnderTest).receivePayLoad(transactionPipeline);
    verify(innerLocalTxStepVisitorUnderTest).receivePayLoadGTX(transactionPipeline, gtx);
}