basic middleware for tests