Fix GenericApplicationContextTests on Microsoft Windows

The tests introduced in commit 9868c28c73 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
This commit is contained in:
jason
2022-07-02 22:20:39 +08:00
committed by Sam Brannen
parent c5987d7c37
commit 59180e76a7

View File

@@ -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);
}