ticket:3 added test for middleware work