Revert "Fix ApplicationResourceLoaderTests on Windows"
This reverts commit 09ac085a6a.
This commit is contained in:
@@ -73,13 +73,12 @@ class ApplicationResourceLoaderTests {
|
||||
@Test
|
||||
void shouldLoadAbsolutePathWithWorkingDirectory() throws IOException {
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
Path workingDirectory = Path.of("/working-directory");
|
||||
Resource resource = ApplicationResourceLoader
|
||||
.get(classLoader, SpringFactoriesLoader.forDefaultResourceLocation(classLoader), workingDirectory)
|
||||
.getResource("/file.txt");
|
||||
.get(classLoader, SpringFactoriesLoader.forDefaultResourceLocation(classLoader),
|
||||
Path.of("/working-directory"))
|
||||
.getResource("/root/file.txt");
|
||||
assertThat(resource.isFile()).isTrue();
|
||||
assertThat(resource.getFile()).hasName("file.txt")
|
||||
.satisfies((file) -> assertThat(file.getParentFile()).isNotEqualTo(workingDirectory));
|
||||
assertThat(resource.getFile()).hasParent("/root").hasName("file.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -171,13 +170,12 @@ class ApplicationResourceLoaderTests {
|
||||
@Test
|
||||
void shouldLoadAbsoluteFileUrisWithWorkingDirectory() throws IOException {
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
Path workingDirectory = Path.of("/working-directory");
|
||||
Resource resource = ApplicationResourceLoader
|
||||
.get(classLoader, SpringFactoriesLoader.forDefaultResourceLocation(classLoader), workingDirectory)
|
||||
.get(classLoader, SpringFactoriesLoader.forDefaultResourceLocation(classLoader),
|
||||
Path.of("/working-directory"))
|
||||
.getResource("file:/file.txt");
|
||||
assertThat(resource.isFile()).isTrue();
|
||||
assertThat(resource.getFile()).hasName("file.txt")
|
||||
.satisfies((file) -> assertThat(file.getParentFile()).isNotEqualTo(workingDirectory));
|
||||
assertThat(resource.getFile()).hasParent("/").hasName("file.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user