ticket:3 Middleware test related changes