diff --git a/spring-context/src/test/java/org/springframework/context/support/GenericApplicationContextTests.java b/spring-context/src/test/java/org/springframework/context/support/GenericApplicationContextTests.java index 6f0abe360c..6a3f3e5773 100644 --- a/spring-context/src/test/java/org/springframework/context/support/GenericApplicationContextTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/GenericApplicationContextTests.java @@ -237,10 +237,11 @@ class GenericApplicationContextTests { context.setResourceLoader(resourceLoader); } + String relativePathLocation = "foo"; String pingLocation = "ping:foo"; String fileLocation = "file:foo"; - Resource resource = context.getResource(pingLocation); + Resource resource = context.getResource(relativePathLocation); assertThat(resource).isInstanceOf(defaultResourceType); resource = context.getResource(fileLocation); assertThat(resource).isInstanceOf(FileUrlResource.class); @@ -251,6 +252,9 @@ class GenericApplicationContextTests { assertThat(resource).asInstanceOf(type(ByteArrayResource.class)) .extracting(bar -> new String(bar.getByteArray(), UTF_8)) .isEqualTo("pong:foo"); + + resource = context.getResource(relativePathLocation); + assertThat(resource).isInstanceOf(defaultResourceType); resource = context.getResource(fileLocation); assertThat(resource).isInstanceOf(FileUrlResource.class); }