Merge branch '3.1.x'

This commit is contained in:
Andy Wilkinson 2023-12-14 20:17:29 +00:00
commit 5915db09e6

View File

@ -96,9 +96,14 @@ class StaticResourceJarsTests {
File jarFile = createResourcesJar("test-resources.jar");
TrackedURLStreamHandler handler = new TrackedURLStreamHandler(true);
URL url = new URL("jar", null, 0, jarFile.toURI().toURL().toString() + "!/", handler);
new StaticResourceJars().getUrlsFrom(url);
assertThatNoException()
.isThrownBy(() -> ((JarURLConnection) handler.getConnection()).getJarFile().getComment());
try {
new StaticResourceJars().getUrlsFrom(url);
assertThatNoException()
.isThrownBy(() -> ((JarURLConnection) handler.getConnection()).getJarFile().getComment());
}
finally {
((JarURLConnection) handler.getConnection()).getJarFile().close();
}
}
@Test