getUrl() refactoring in tests