parent
f35ed8d044
commit
ca820c914f
|
|
@ -29,7 +29,6 @@ import org.springframework.util.Assert;
|
|||
* Parser for URI's based on RFC 3986 syntax.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Yanming Zhou
|
||||
* @since 6.2
|
||||
*
|
||||
* @see <a href="https://www.rfc-editor.org/info/rfc3986">RFC 3986</a>
|
||||
|
|
|
|||
|
|
@ -633,29 +633,17 @@ class UriComponentsBuilderTests {
|
|||
@ParameterizedTest // gh-33699
|
||||
@EnumSource(value = ParserType.class)
|
||||
void schemeVariableMixedCase(ParserType parserType) {
|
||||
URI uri = UriComponentsBuilder
|
||||
.fromUriString("{TheScheme}://example.org", parserType)
|
||||
.buildAndExpand(Map.of("TheScheme", "ws"))
|
||||
.toUri();
|
||||
assertThat(uri.toString()).isEqualTo("ws://example.org");
|
||||
|
||||
uri = UriComponentsBuilder
|
||||
.fromUriString("{TheScheme}s://example.org", parserType)
|
||||
.buildAndExpand(Map.of("TheScheme", "ws"))
|
||||
BiConsumer<String, String> tester = (scheme, value) -> {
|
||||
URI uri = UriComponentsBuilder.fromUriString(scheme + "://example.org", parserType)
|
||||
.buildAndExpand(Map.of("TheScheme", value))
|
||||
.toUri();
|
||||
assertThat(uri.toString()).isEqualTo("wss://example.org");
|
||||
};
|
||||
|
||||
uri = UriComponentsBuilder
|
||||
.fromUriString("s{TheScheme}://example.org", parserType)
|
||||
.buildAndExpand(Map.of("TheScheme", "ws"))
|
||||
.toUri();
|
||||
assertThat(uri.toString()).isEqualTo("sws://example.org");
|
||||
|
||||
uri = UriComponentsBuilder
|
||||
.fromUriString("s{TheScheme}s://example.org", parserType)
|
||||
.buildAndExpand(Map.of("TheScheme", "ws"))
|
||||
.toUri();
|
||||
assertThat(uri.toString()).isEqualTo("swss://example.org");
|
||||
tester.accept("{TheScheme}", "wss");
|
||||
tester.accept("{TheScheme}s", "ws");
|
||||
tester.accept("ws{TheScheme}", "s");
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
|
|
|
|||
Loading…
Reference in New Issue