added test cases for middleware to test.