From 49da92b6a3a67f015d04712abb1891cba7930e77 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 25 Sep 2024 13:53:34 +0200 Subject: [PATCH] Avoid http URL String (making checkstyleNohttp happy) See gh-33561 --- .../org/springframework/core/io/ResourceTests.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-core/src/test/java/org/springframework/core/io/ResourceTests.java b/spring-core/src/test/java/org/springframework/core/io/ResourceTests.java index 4360faa5381e..14882f0b7437 100644 --- a/spring-core/src/test/java/org/springframework/core/io/ResourceTests.java +++ b/spring-core/src/test/java/org/springframework/core/io/ResourceTests.java @@ -380,8 +380,8 @@ void relativeResourcesAreEqual() throws Exception { @Test void unusualRelativeResourcesAreEqual() throws Exception { Resource resource = new UrlResource("file:dir/"); - Resource relative = resource.createRelative("http://spring.io"); - assertThat(relative).isEqualTo(new UrlResource("file:dir/http://spring.io")); + Resource relative = resource.createRelative("https://spring.io"); + assertThat(relative).isEqualTo(new UrlResource("file:dir/https://spring.io")); } @Test @@ -422,14 +422,14 @@ void canCustomizeHttpUrlConnectionForRead() throws Exception { @Test void useUserInfoToSetBasicAuth() throws Exception { startServer(); - UrlResource resource = new UrlResource("http://alice:secret@localhost:" - + this.server.getPort() + "/resource"); + UrlResource resource = new UrlResource( + "http://alice:secret@localhost:" + this.server.getPort() + "/resource"); assertThat(resource.getInputStream()).hasContent("Spring"); RecordedRequest request = this.server.takeRequest(); String authorization = request.getHeader("Authorization"); assertThat(authorization).isNotNull().startsWith("Basic "); - assertThat(new String(Base64.getDecoder().decode( - authorization.substring(6)), StandardCharsets.ISO_8859_1)).isEqualTo("alice:secret"); + assertThat(new String(Base64.getDecoder().decode(authorization.substring(6)), + StandardCharsets.ISO_8859_1)).isEqualTo("alice:secret"); } @AfterEach