Consistent MvcUriComponentsBuilder assertion handling
(cherry picked from commit 61b47ba)