### Question:
DefaultGlobalTransaction implements GlobalTransaction { @Override public void begin() throws TransactionException { begin(DEFAULT_GLOBAL_TX_TIMEOUT); } DefaultGlobalTransaction();   DefaultGlobalTransaction(String xid, GlobalStatus status, GlobalTransactionRole role); @Override void begin(); @Override void begin(int timeout); @Override void begin(int timeout, String name); @Override void commit(); @Override void rollback(); @Override SuspendedResourcesHolder suspend(boolean unbindXid); @Override void resume(SuspendedResourcesHolder suspendedResourcesHolder); @Override GlobalStatus getStatus(); @Override String getXid(); @Override void globalReport(GlobalStatus globalStatus); @Override GlobalStatus getLocalStatus();  }### Answer:
@Test public void commitRetryExceptionTest() throws TransactionException { RootContext.unbind(); GlobalTransaction tx = GlobalTransactionContext.getCurrentOrCreate(); tx.begin(); Assertions.assertThrows(TransactionException.class, tx::commit); }
@Test public void rollBackRetryExceptionTest() throws TransactionException { RootContext.unbind(); GlobalTransaction tx = GlobalTransactionContext.getCurrentOrCreate(); tx.begin(); Assertions.assertThrows(TransactionException.class, tx::rollback); }
@Test public void rollBackNoXIDExceptionTest() throws TransactionException { RootContext.unbind(); GlobalTransaction tx = GlobalTransactionContext.getCurrentOrCreate(); tx.begin(); Assertions.assertThrows(TransactionException.class, tx::rollback); }