Refactoring of assertUrl call

Refactoring of assertUrl call to eliminate duplicate statements