add tests for middleware registeration