Polish
Closes gh-22705
This commit is contained in:
@@ -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<String, ?> uriVariables);
|
||||
|
||||
/**
|
||||
* Build the URI for the request using the {@link UriBuilderFactory}
|
||||
* configured for this client and initialized with the specified <code>uri</code>.
|
||||
* 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<UriBuilder, URI> 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<UriBuilder, URI> uriFunction);
|
||||
|
||||
@@ -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").<String>get());
|
||||
assertEquals("/path/{id}", request.attribute(WebClient.class.getName() + ".uriTemplate").get());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user