Skip to content

Commit 59180e7

Browse files
jasonjiang9527sbrannen
authored andcommitted
Fix GenericApplicationContextTests on Microsoft Windows
The tests introduced in commit 9868c28 pass on Mac OS and Linux but fail on Microsoft Windows. This commit updates the tests so that they pass on MS Windows as well. See gh-28703 Closes gh-28746
1 parent c5987d7 commit 59180e7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spring-context/src/test/java/org/springframework/context/support/GenericApplicationContextTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,11 @@ private void assertGetResourceSemantics(ResourceLoader resourceLoader, Class<? e
237237
context.setResourceLoader(resourceLoader);
238238
}
239239

240+
String relativePathLocation = "foo";
240241
String pingLocation = "ping:foo";
241242
String fileLocation = "file:foo";
242243

243-
Resource resource = context.getResource(pingLocation);
244+
Resource resource = context.getResource(relativePathLocation);
244245
assertThat(resource).isInstanceOf(defaultResourceType);
245246
resource = context.getResource(fileLocation);
246247
assertThat(resource).isInstanceOf(FileUrlResource.class);
@@ -251,6 +252,9 @@ private void assertGetResourceSemantics(ResourceLoader resourceLoader, Class<? e
251252
assertThat(resource).asInstanceOf(type(ByteArrayResource.class))
252253
.extracting(bar -> new String(bar.getByteArray(), UTF_8))
253254
.isEqualTo("pong:foo");
255+
256+
resource = context.getResource(relativePathLocation);
257+
assertThat(resource).isInstanceOf(defaultResourceType);
254258
resource = context.getResource(fileLocation);
255259
assertThat(resource).isInstanceOf(FileUrlResource.class);
256260
}

0 commit comments

Comments
 (0)