Skip to content

Commit 5883fc2

Browse files
committed
Revert "Fix ApplicationResourceLoaderTests on Windows"
This reverts commit 09ac085.
1 parent af51660 commit 5883fc2

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/io/ApplicationResourceLoaderTests.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,12 @@ void shouldLoadAbsolutePath() throws IOException {
7373
@Test
7474
void shouldLoadAbsolutePathWithWorkingDirectory() throws IOException {
7575
ClassLoader classLoader = getClass().getClassLoader();
76-
Path workingDirectory = Path.of("/working-directory");
7776
Resource resource = ApplicationResourceLoader
78-
.get(classLoader, SpringFactoriesLoader.forDefaultResourceLocation(classLoader), workingDirectory)
79-
.getResource("/file.txt");
77+
.get(classLoader, SpringFactoriesLoader.forDefaultResourceLocation(classLoader),
78+
Path.of("/working-directory"))
79+
.getResource("/root/file.txt");
8080
assertThat(resource.isFile()).isTrue();
81-
assertThat(resource.getFile()).hasName("file.txt")
82-
.satisfies((file) -> assertThat(file.getParentFile()).isNotEqualTo(workingDirectory));
81+
assertThat(resource.getFile()).hasParent("/root").hasName("file.txt");
8382
}
8483

8584
@Test
@@ -171,13 +170,12 @@ void shouldLoadRelativeFileUrisWithWorkingDirectory() throws IOException {
171170
@Test
172171
void shouldLoadAbsoluteFileUrisWithWorkingDirectory() throws IOException {
173172
ClassLoader classLoader = getClass().getClassLoader();
174-
Path workingDirectory = Path.of("/working-directory");
175173
Resource resource = ApplicationResourceLoader
176-
.get(classLoader, SpringFactoriesLoader.forDefaultResourceLocation(classLoader), workingDirectory)
174+
.get(classLoader, SpringFactoriesLoader.forDefaultResourceLocation(classLoader),
175+
Path.of("/working-directory"))
177176
.getResource("file:/file.txt");
178177
assertThat(resource.isFile()).isTrue();
179-
assertThat(resource.getFile()).hasName("file.txt")
180-
.satisfies((file) -> assertThat(file.getParentFile()).isNotEqualTo(workingDirectory));
178+
assertThat(resource.getFile()).hasParent("/").hasName("file.txt");
181179
}
182180

183181
@Test

0 commit comments

Comments
 (0)