Refactored unit tests for UrlRewriter