@Test
public void testGetBubleMessageLocalPipelineWhenEventRegistred() {

    // Setup
    final LocalTransactionStepDefinition pipeline = mock(LocalTransactionStepDefinition.class);
    final BaseTransactionEvent event = mock(BaseTransactionEvent.class);
    final String eventId = "eventid";
    final BubbleMessage message = mock(BubbleMessage.class);
    when(pipeline.getIn()).thenReturn(event);
    when(event.getId()).thenReturn(eventId);
    when(mockBubbleCache.getBubble(eventId)).thenReturn(Optional.of(message));
    // Run the test
    final Optional<BubbleMessage> result = transactionUtilitiesUnderTest.getBubleMessage(pipeline);
    // Verify the results
    assertEquals(Optional.of(message), result);
}