Skip to content

Commit 49da92b

Browse files
committed
Avoid http URL String (making checkstyleNohttp happy)
See gh-33561
1 parent daa109e commit 49da92b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spring-core/src/test/java/org/springframework/core/io/ResourceTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ void relativeResourcesAreEqual() throws Exception {
380380
@Test
381381
void unusualRelativeResourcesAreEqual() throws Exception {
382382
Resource resource = new UrlResource("file:dir/");
383-
Resource relative = resource.createRelative("http://spring.io");
384-
assertThat(relative).isEqualTo(new UrlResource("file:dir/http://spring.io"));
383+
Resource relative = resource.createRelative("https://spring.io");
384+
assertThat(relative).isEqualTo(new UrlResource("file:dir/https://spring.io"));
385385
}
386386

387387
@Test
@@ -422,14 +422,14 @@ void canCustomizeHttpUrlConnectionForRead() throws Exception {
422422
@Test
423423
void useUserInfoToSetBasicAuth() throws Exception {
424424
startServer();
425-
UrlResource resource = new UrlResource("http://alice:secret@localhost:"
426-
+ this.server.getPort() + "/resource");
425+
UrlResource resource = new UrlResource(
426+
"http://alice:secret@localhost:" + this.server.getPort() + "/resource");
427427
assertThat(resource.getInputStream()).hasContent("Spring");
428428
RecordedRequest request = this.server.takeRequest();
429429
String authorization = request.getHeader("Authorization");
430430
assertThat(authorization).isNotNull().startsWith("Basic ");
431-
assertThat(new String(Base64.getDecoder().decode(
432-
authorization.substring(6)), StandardCharsets.ISO_8859_1)).isEqualTo("alice:secret");
431+
assertThat(new String(Base64.getDecoder().decode(authorization.substring(6)),
432+
StandardCharsets.ISO_8859_1)).isEqualTo("alice:secret");
433433
}
434434

435435
@AfterEach

0 commit comments

Comments
 (0)