adding unit tests for rewrite_v1 middleware