try {
lifecycleEvent.fire(new BeforeTransactionEnded());
TransactionProvider transactionProvider = getTransactionProvider();
TransactionalTest transactionalTest = new TransactionalTestImpl(getTransactionManager(afterTest));
if (rollbackRequired(afterTest)) {
transactionProvider.rollbackTransaction(transactionalTest);
} else {
transactionProvider.commitTransaction(transactionalTest);