@BeforeMethod
public void setUp() throws XAException {
Cache mockCache = mock(Cache.class);
Configuration configuration = new ConfigurationBuilder().build();
XaTransactionTable txTable = new XaTransactionTable();
txCoordinator = new TransactionCoordinator();
TestingUtil.inject(txTable, configuration, txCoordinator, TransactionOriginatorChecker.LOCAL);
txTable.start();
txTable.startXidMapping();
TransactionFactory gtf = new TransactionFactory();
gtf.init(false, false, true, false);
GlobalTransaction globalTransaction = gtf.newGlobalTransaction(null, false);
EmbeddedBaseTransactionManager tm = new EmbeddedBaseTransactionManager();
localTx = new LocalXaTransaction(new EmbeddedTransaction(tm), globalTransaction, false, 1, 0);
xid = new EmbeddedXid(uuid);
InvocationContextFactory icf = new TransactionalInvocationContextFactory();
CommandsFactory commandsFactory = mock(CommandsFactory.class);
AsyncInterceptorChain invoker = mock(AsyncInterceptorChain.class);
TestingUtil.inject(txCoordinator, commandsFactory, icf, invoker, txTable, configuration);
xaAdapter = new TransactionXaAdapter(localTx, txTable);
xaAdapter.start(xid, 0);
}