Add test case for init middleware.