ServletUriComponentsBuilder uses HttpServletRequest#getQueryString to build on the current request.
However, in a GET or HEAD request, MockHttpServletRequestBuilder#param only adds to the combined parameter map and not the query string, causing it to fail.
The workaround is to provide the parameters directly in the URI string, but this is inferior to the fluent API. The different behaviour is probably surprising to many users.
See also spring-projects/spring-restdocs#26
ServletUriComponentsBuilderusesHttpServletRequest#getQueryStringto build on the current request.However, in a GET or HEAD request,
MockHttpServletRequestBuilder#paramonly adds to the combined parameter map and not the query string, causing it to fail.The workaround is to provide the parameters directly in the URI string, but this is inferior to the fluent API. The different behaviour is probably surprising to many users.
See also spring-projects/spring-restdocs#26