- added test for middleware.