Skip to content

Commit

Permalink
Improve documentation for uri(URI) method in WebTestClient
Browse files Browse the repository at this point in the history
Prior to this commit, it was not clear that a configured base URI would
not be applied when invoking uri(URI).

This commit adds a note to the Javadoc to clarify that behavior.

Closes gh-28058
  • Loading branch information
sbrannen committed Feb 16, 2022
1 parent e3ceb9b commit 3ac6014
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,22 +526,27 @@ interface Builder {
interface UriSpec<S extends RequestHeadersSpec<?>> {

/**
* Specify the URI using an absolute, fully constructed {@link URI}.
* Specify the URI using an absolute, fully constructed {@link java.net.URI}.
* <p>If a {@link UriBuilderFactory} was configured for the client with
* a base URI, that base URI will <strong>not</strong> be applied to the
* supplied {@code java.net.URI}. If you wish to have a base URI applied to a
* {@code java.net.URI} you must invoke either {@link #uri(String, Object...)}
* or {@link #uri(String, Map)} &mdash; for example, {@code uri(myUri.toString())}.
* @return spec to add headers or perform the exchange
*/
S uri(URI uri);

/**
* Specify the URI for the request using a URI template and URI variables.
* If a {@link UriBuilderFactory} was configured for the client (e.g.
* <p>If a {@link UriBuilderFactory} was configured for the client (e.g.
* with a base URI) it will be used to expand the URI template.
* @return spec to add headers or perform the exchange
*/
S uri(String uri, Object... uriVariables);

/**
* Specify the URI for the request using a URI template and URI variables.
* If a {@link UriBuilderFactory} was configured for the client (e.g.
* <p>If a {@link UriBuilderFactory} was configured for the client (e.g.
* with a base URI) it will be used to expand the URI template.
* @return spec to add headers or perform the exchange
*/
Expand Down

0 comments on commit 3ac6014

Please sign in to comment.