Skip to content

Commit

Permalink
Add error message to MockServerHttpRequest
Browse files Browse the repository at this point in the history
Closes gh-25109
  • Loading branch information
rstoyanchev committed May 27, 2020
1 parent e9a9883 commit 955f77b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Expand Up @@ -232,6 +232,8 @@ public static BodyBuilder method(HttpMethod method, URI url) {
* @return the created builder
*/
public static BodyBuilder method(HttpMethod method, String urlTemplate, Object... vars) {
Assert.notNull(method, "HttpMethod is required. If testing a custom HTTP method, " +
"please use the variant that accepts a String based HTTP method.");
URI url = UriComponentsBuilder.fromUriString(urlTemplate).buildAndExpand(vars).encode().toUri();
return new DefaultBodyBuilder(method, url);
}
Expand Down
Expand Up @@ -232,6 +232,8 @@ public static BodyBuilder method(HttpMethod method, URI url) {
* @return the created builder
*/
public static BodyBuilder method(HttpMethod method, String urlTemplate, Object... vars) {
Assert.notNull(method, "HttpMethod is required. If testing a custom HTTP method, " +
"please use the variant that accepts a String based HTTP method.");
URI url = UriComponentsBuilder.fromUriString(urlTemplate).buildAndExpand(vars).encode().toUri();
return new DefaultBodyBuilder(method, url);
}
Expand Down

0 comments on commit 955f77b

Please sign in to comment.