BusinessLocalTransactionManagerImpl implements BusinessLocalTransactionManager { @Override public Optional<GlobalTransaction> findGlobalTransaction(final String GTX) { return this.globalTransactionRepository.findById(GTX); } 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);  }
@Test public void testFindGlobalTransaction() { final String GTX = "GTX"; final GlobalTransaction globalTransaction = mock(GlobalTransaction.class); when(mockGlobalTransactionRepository.findById(anyString())).thenReturn(Optional.of(globalTransaction)); final Optional<GlobalTransaction> result = businessLocalTransactionManagerImplUnderTest.findGlobalTransaction(GTX); assertEquals(Optional.of(globalTransaction), result); }