Skip to content

Commit e0c2a1c

Browse files
committed
Polish
Closes gh-22705
1 parent 9976783 commit e0c2a1c

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -349,14 +349,14 @@ interface UriSpec<S extends RequestHeadersSpec<?>> {
349349
S uri(String uri, Map<String, ?> uriVariables);
350350

351351
/**
352-
* Build the URI for the request using the {@link UriBuilderFactory}
353-
* configured for this client and initialized with the specified <code>uri</code>.
352+
* Specify the URI starting with a URI template and finishing off with a
353+
* {@link UriBuilder} created from the template.
354+
* @since 5.2
354355
*/
355356
S uri(String uri, Function<UriBuilder, URI> uriFunction);
356357

357358
/**
358-
* Build the URI for the request using the {@link UriBuilderFactory}
359-
* configured for this client.
359+
* Specify the URI by through a {@link UriBuilder}.
360360
* @see #uri(String, Function)
361361
*/
362362
S uri(Function<UriBuilder, URI> uriFunction);

spring-webflux/src/test/java/org/springframework/web/reactive/function/client/DefaultWebClientTests.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,15 @@ public void uriBuilder() {
8484
assertEquals("/base/path?q=12", request.url().toString());
8585
}
8686

87-
88-
@Test
87+
@Test // gh-22705
8988
public void uriBuilderWithUriTemplate() {
9089
this.builder.build().get()
9190
.uri("/path/{id}", builder -> builder.queryParam("q", "12").build("identifier"))
9291
.exchange().block(Duration.ofSeconds(10));
9392

9493
ClientRequest request = verifyAndGetRequest();
9594
assertEquals("/base/path/identifier?q=12", request.url().toString());
96-
assertEquals("/path/{id}", request.attribute(WebClient.class.getName() + ".uriTemplate").<String>get());
95+
assertEquals("/path/{id}", request.attribute(WebClient.class.getName() + ".uriTemplate").get());
9796
}
9897

9998
@Test

0 commit comments

Comments
 (0)