@Test
public void testGetLocalTransactionWhenGlobalTxExist() {

    // Setup
    final String gtx = "gtx";
    final String name = "name";
    final LocalTransaction localTransaction = mock(LocalTransaction.class);
    final GlobalTransaction globalTransaction = mock(GlobalTransaction.class);
    when(mockGlobalTransactionRepository.findById(gtx)).thenReturn(Optional.of(globalTransaction));
    when(globalTransaction.getLocalTransactions()).thenReturn(Arrays.asList(localTransaction));
    when(localTransaction.getName()).thenReturn(name);
    // Run the test
    final Optional<LocalTransaction> result = businessLocalTransactionManagerImplUnderTest.getLocalTransaction(gtx, name,null);
    // Verify the results
    assertEquals(localTransaction, result.get());
}