@@ -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