@Test public void testBeginWhenGlobalTxNotNew() { when(globalTransaction.isNew()).thenReturn(false); businessGlobalTransactionManagerImplUnderTest.begin(pipeline); verify(mockGlobalTransactionRepository).save(same(globalTransaction)); verify(pipeline, never()).accept(any()); }
@Override public void begin(GlobalTransactionStepDefinition pipeline) { Optional<RequestGlobalTransaction> orgt = globalTransactionMapper.mapTo(pipeline); GlobalTransaction globalTransaction = businessGlobalTransactionService.participateToGlobalTransaction(orgt); globalTransactionRepository.save(globalTransaction); if (globalTransaction.isNew()) { pipeline.accept(buildInnerGlobalTxStep(Optional.of(globalTransaction))); } }
BusinessGlobalTransactionManagerImpl implements BusinessGlobalTransactionManager { @Override public void begin(GlobalTransactionStepDefinition pipeline) { Optional<RequestGlobalTransaction> orgt = globalTransactionMapper.mapTo(pipeline); GlobalTransaction globalTransaction = businessGlobalTransactionService.participateToGlobalTransaction(orgt); globalTransactionRepository.save(globalTransaction); if (globalTransaction.isNew()) { pipeline.accept(buildInnerGlobalTxStep(Optional.of(globalTransaction))); } } }
BusinessGlobalTransactionManagerImpl implements BusinessGlobalTransactionManager { @Override public void begin(GlobalTransactionStepDefinition pipeline) { Optional<RequestGlobalTransaction> orgt = globalTransactionMapper.mapTo(pipeline); GlobalTransaction globalTransaction = businessGlobalTransactionService.participateToGlobalTransaction(orgt); globalTransactionRepository.save(globalTransaction); if (globalTransaction.isNew()) { pipeline.accept(buildInnerGlobalTxStep(Optional.of(globalTransaction))); } } @Autowired  BusinessGlobalTransactionManagerImpl(GlobalTransactionRepository globalTransactionRepository,
			CommandOrchestrator commandOrchestrator, ApplicationEventPublisher applicationEventPublisher,
			BubbleCache bubbleCache , BusinessGlobalTransactionService businessGlobalTransactionService , GlobalTransactionMapper globalTransactionMapper, TransactionUtilities utilities); }
BusinessGlobalTransactionManagerImpl implements BusinessGlobalTransactionManager { @Override public void begin(GlobalTransactionStepDefinition pipeline) { Optional<RequestGlobalTransaction> orgt = globalTransactionMapper.mapTo(pipeline); GlobalTransaction globalTransaction = businessGlobalTransactionService.participateToGlobalTransaction(orgt); globalTransactionRepository.save(globalTransaction); if (globalTransaction.isNew()) { pipeline.accept(buildInnerGlobalTxStep(Optional.of(globalTransaction))); } } @Autowired  BusinessGlobalTransactionManagerImpl(GlobalTransactionRepository globalTransactionRepository,
			CommandOrchestrator commandOrchestrator, ApplicationEventPublisher applicationEventPublisher,
			BubbleCache bubbleCache , BusinessGlobalTransactionService businessGlobalTransactionService , GlobalTransactionMapper globalTransactionMapper, TransactionUtilities utilities); @Override void begin(GlobalTransactionStepDefinition pipeline); @Override void commit(GlobalTransactionStepDefinition pipeline); }
BusinessGlobalTransactionManagerImpl implements BusinessGlobalTransactionManager { @Override public void begin(GlobalTransactionStepDefinition pipeline) { Optional<RequestGlobalTransaction> orgt = globalTransactionMapper.mapTo(pipeline); GlobalTransaction globalTransaction = businessGlobalTransactionService.participateToGlobalTransaction(orgt); globalTransactionRepository.save(globalTransaction); if (globalTransaction.isNew()) { pipeline.accept(buildInnerGlobalTxStep(Optional.of(globalTransaction))); } } @Autowired  BusinessGlobalTransactionManagerImpl(GlobalTransactionRepository globalTransactionRepository,
			CommandOrchestrator commandOrchestrator, ApplicationEventPublisher applicationEventPublisher,
			BubbleCache bubbleCache , BusinessGlobalTransactionService businessGlobalTransactionService , GlobalTransactionMapper globalTransactionMapper, TransactionUtilities utilities); @Override void begin(GlobalTransactionStepDefinition pipeline); @Override void commit(GlobalTransactionStepDefinition pipeline);  }