@Test public void testGetBubleMessageGlobalPipelineWhenEventRegistred() { final GlobalTransactionStepDefinition pipeline = mock(GlobalTransactionStepDefinition.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)); final Optional<BubbleMessage> result = transactionUtilitiesUnderTest.getBubleMessage(pipeline); assertEquals(Optional.of(message), result); }
public Optional<BubbleMessage> getBubleMessage(GlobalTransactionStepDefinition pipeline) { String eventId = pipeline.getIn().getId(); return bubbleCache.getBubble(eventId); }
TransactionUtilities { public Optional<BubbleMessage> getBubleMessage(GlobalTransactionStepDefinition pipeline) { String eventId = pipeline.getIn().getId(); return bubbleCache.getBubble(eventId); } }
TransactionUtilities { public Optional<BubbleMessage> getBubleMessage(GlobalTransactionStepDefinition pipeline) { String eventId = pipeline.getIn().getId(); return bubbleCache.getBubble(eventId); } TransactionUtilities(BubbleCache bubbleCache); }
TransactionUtilities { public Optional<BubbleMessage> getBubleMessage(GlobalTransactionStepDefinition pipeline) { String eventId = pipeline.getIn().getId(); return bubbleCache.getBubble(eventId); } TransactionUtilities(BubbleCache bubbleCache); Optional<BubbleMessage> getBubleMessage(GlobalTransactionStepDefinition pipeline); Optional<BubbleMessage> getBubleMessage(LocalTransactionStepDefinition pipeline); }
TransactionUtilities { public Optional<BubbleMessage> getBubleMessage(GlobalTransactionStepDefinition pipeline) { String eventId = pipeline.getIn().getId(); return bubbleCache.getBubble(eventId); } TransactionUtilities(BubbleCache bubbleCache); Optional<BubbleMessage> getBubleMessage(GlobalTransactionStepDefinition pipeline); Optional<BubbleMessage> getBubleMessage(LocalTransactionStepDefinition pipeline);  }