Implement runInTransaction method for UnitTest