Fixed #19645 -- Added tests for TransactionMiddleware