I added the unit tests / code for request middleware.