ticket3:added test for middleware