Fix regression with opaque URI determination
Before RfcUriParser we expected opaque URI's to not have ":/" after the scheme while the new parser expect opaque URI's to not have a slash anywhere after the scheme. This commit restores the previous behavior. Closes gh-34588
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 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.
|
||||
@@ -155,6 +155,19 @@ class UriComponentsBuilderTests {
|
||||
assertThat(result.toUri()).as("Invalid result URI").isEqualTo(uri);
|
||||
}
|
||||
|
||||
@ParameterizedTest // see gh-34588
|
||||
@EnumSource
|
||||
void fromOpaqueUriWithUrnScheme(ParserType parserType) {
|
||||
URI uri = UriComponentsBuilder
|
||||
.fromUriString("urn:text:service-{region}:{prefix}/{id}", parserType).build()
|
||||
.expand("US", "prefix1", "Id-2")
|
||||
.toUri();
|
||||
|
||||
assertThat(uri.getScheme()).isEqualTo("urn");
|
||||
assertThat(uri.isOpaque()).isTrue();
|
||||
assertThat(uri.getSchemeSpecificPart()).isEqualTo("text:service-US:prefix1/Id-2");
|
||||
}
|
||||
|
||||
@ParameterizedTest // see gh-9317
|
||||
@EnumSource
|
||||
void fromUriEncodedQuery(ParserType parserType) {
|
||||
|
||||
Reference in New Issue
Block a user