diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java index ef511c9bb4..1a7f366076 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -349,14 +349,14 @@ public interface WebClient { S uri(String uri, Map uriVariables); /** - * Build the URI for the request using the {@link UriBuilderFactory} - * configured for this client and initialized with the specified uri. + * Specify the URI starting with a URI template and finishing off with a + * {@link UriBuilder} created from the template. + * @since 5.2 */ S uri(String uri, Function uriFunction); /** - * Build the URI for the request using the {@link UriBuilderFactory} - * configured for this client. + * Specify the URI by through a {@link UriBuilder}. * @see #uri(String, Function) */ S uri(Function uriFunction); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/DefaultWebClientTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/DefaultWebClientTests.java index 26167646b1..70c38eee1d 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/DefaultWebClientTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/DefaultWebClientTests.java @@ -84,8 +84,7 @@ public class DefaultWebClientTests { assertEquals("/base/path?q=12", request.url().toString()); } - - @Test + @Test // gh-22705 public void uriBuilderWithUriTemplate() { this.builder.build().get() .uri("/path/{id}", builder -> builder.queryParam("q", "12").build("identifier")) @@ -93,7 +92,7 @@ public class DefaultWebClientTests { ClientRequest request = verifyAndGetRequest(); assertEquals("/base/path/identifier?q=12", request.url().toString()); - assertEquals("/path/{id}", request.attribute(WebClient.class.getName() + ".uriTemplate").get()); + assertEquals("/path/{id}", request.attribute(WebClient.class.getName() + ".uriTemplate").get()); } @Test