AtomikosTransactionManager implements XATransactionManager { @SneakyThrows({SystemException.class, RollbackException.class}) @Override public void enlistResource(final SingleXAResource xaResource) { transactionManager.getTransaction().enlistResource(xaResource); }  @Override void init(); @Override void registerRecoveryResource(final String dataSourceName, final XADataSource xaDataSource); @Override void removeRecoveryResource(final String dataSourceName, final XADataSource xaDataSource); @SneakyThrows({SystemException.class, RollbackException.class}) @Override void enlistResource(final SingleXAResource xaResource); @Override TransactionManager getTransactionManager(); @Override void close();  }
@Test public void assertEnListResource() throws SystemException, RollbackException { SingleXAResource singleXAResource = mock(SingleXAResource.class); Transaction transaction = mock(Transaction.class); when(userTransactionManager.getTransaction()).thenReturn(transaction); atomikosTransactionManager.enlistResource(singleXAResource); verify(transaction).enlistResource(singleXAResource); }