code coverage for middleware