Closes gh-22705
This commit is contained in:
Rossen Stoyanchev
2019-04-04 17:13:07 -04:00
parent 9976783639
commit e0c2a1c59d
2 changed files with 7 additions and 8 deletions

View File

@@ -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);

View File

@@ -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