-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Closed
Copy link
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
Spring version: 7.0.1
Test class
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
import org.springframework.core.SpringVersion;
import org.springframework.web.util.UriComponentsBuilder;
class UriComponentsBuilderTest {
@Test
void singleCharacterInFragment() {
System.out.println("Spring version: " + SpringVersion.getVersion());
var ucb = UriComponentsBuilder.fromUriString("https://example.com/path#1");
assertThat(ucb.toUriString()).isEqualTo("https://example.com/path#1");
}
}Test output
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.example.demo.UriComponentsBuilderTest
Spring version: 7.0.1
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.070 s <<< FAILURE! -- in com.example.demo.UriComponentsBuilderTest
[ERROR] com.example.demo.UriComponentsBuilderTest.singleCharacterInFragment -- Time elapsed: 0.064 s <<< FAILURE!
org.opentest4j.AssertionFailedError:
expected: "https://example.com/path#1"
but was: "https://example.com/path"
at com.example.demo.UriComponentsBuilderTest.singleCharacterInFragment(UriComponentsBuilderTest.java:15)Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug