@Test public void testUpdateLTXWhenMessageNotExist() { final LocalTransactionStepDefinition pipeline = mock(LocalTransactionStepDefinition.class); final LocalTransaction ltx = mock(LocalTransaction.class); final BubbleMessage bubbleMessage = mock(BubbleMessage.class); when(mockTxUtilities.getBubleMessage(pipeline)).thenReturn(Optional.empty()); businessLocalTransactionManagerImplUnderTest.updateLTX(pipeline, ltx); verify(ltx, never()).setFLTX(anyString()); }
void updateLTX(LocalTransactionStepDefinition pipeline, LocalTransaction ltx) { Optional<List<String>> businessKey = pipeline.getBusinessKey(); ltx.addBusinessKey(businessKey); Optional<BubbleMessage> bubbleMessage = txUtilities.getBubleMessage(pipeline); bubbleMessage.ifPresent(msg -> ltx.setFLTX(msg.getFLTX())); }
BusinessLocalTransactionManagerImpl implements BusinessLocalTransactionManager { void updateLTX(LocalTransactionStepDefinition pipeline, LocalTransaction ltx) { Optional<List<String>> businessKey = pipeline.getBusinessKey(); ltx.addBusinessKey(businessKey); Optional<BubbleMessage> bubbleMessage = txUtilities.getBubleMessage(pipeline); bubbleMessage.ifPresent(msg -> ltx.setFLTX(msg.getFLTX())); } }
BusinessLocalTransactionManagerImpl implements BusinessLocalTransactionManager { void updateLTX(LocalTransactionStepDefinition pipeline, LocalTransaction ltx) { Optional<List<String>> businessKey = pipeline.getBusinessKey(); ltx.addBusinessKey(businessKey); Optional<BubbleMessage> bubbleMessage = txUtilities.getBubleMessage(pipeline); bubbleMessage.ifPresent(msg -> ltx.setFLTX(msg.getFLTX())); } BusinessLocalTransactionManagerImpl(GlobalTransactionRepository globalTransactionRepository,
			CommandOrchestrator commandOrchestrator, ApplicationEventPublisher applicationEventPublisher,
			BubbleCache bubbleCache, TransactionUtilities txUtilities); }
BusinessLocalTransactionManagerImpl implements BusinessLocalTransactionManager { void updateLTX(LocalTransactionStepDefinition pipeline, LocalTransaction ltx) { Optional<List<String>> businessKey = pipeline.getBusinessKey(); ltx.addBusinessKey(businessKey); Optional<BubbleMessage> bubbleMessage = txUtilities.getBubleMessage(pipeline); bubbleMessage.ifPresent(msg -> ltx.setFLTX(msg.getFLTX())); } BusinessLocalTransactionManagerImpl(GlobalTransactionRepository globalTransactionRepository,
			CommandOrchestrator commandOrchestrator, ApplicationEventPublisher applicationEventPublisher,
			BubbleCache bubbleCache, TransactionUtilities txUtilities); @Override void begin(final LocalTransactionStepDefinition localTransactionStepDefinition); @Override void commit(
			final LocalTransactionStepDefinition<? extends BaseTransactionEvent> localTransactionStepDefinition); @Override void rollBack(
			LocalTransactionStepDefinition<? extends BaseTransactionEvent> localTransactionStepDefinition); @Override Optional<GlobalTransaction> findGlobalTransaction(final String GTX); }
BusinessLocalTransactionManagerImpl implements BusinessLocalTransactionManager { void updateLTX(LocalTransactionStepDefinition pipeline, LocalTransaction ltx) { Optional<List<String>> businessKey = pipeline.getBusinessKey(); ltx.addBusinessKey(businessKey); Optional<BubbleMessage> bubbleMessage = txUtilities.getBubleMessage(pipeline); bubbleMessage.ifPresent(msg -> ltx.setFLTX(msg.getFLTX())); } BusinessLocalTransactionManagerImpl(GlobalTransactionRepository globalTransactionRepository,
			CommandOrchestrator commandOrchestrator, ApplicationEventPublisher applicationEventPublisher,
			BubbleCache bubbleCache, TransactionUtilities txUtilities); @Override void begin(final LocalTransactionStepDefinition localTransactionStepDefinition); @Override void commit(
			final LocalTransactionStepDefinition<? extends BaseTransactionEvent> localTransactionStepDefinition); @Override void rollBack(
			LocalTransactionStepDefinition<? extends BaseTransactionEvent> localTransactionStepDefinition); @Override Optional<GlobalTransaction> findGlobalTransaction(final String GTX);  }