Remove unnecessary toString calls
See gh-39259
This commit is contained in:
committed by
Phillip Webb
parent
a31319caaa
commit
17902c9cec
@@ -95,7 +95,7 @@ class StaticResourceJarsTests {
|
||||
void doesNotCloseJarFromCachedConnection() throws Exception {
|
||||
File jarFile = createResourcesJar("test-resources.jar");
|
||||
TrackedURLStreamHandler handler = new TrackedURLStreamHandler(true);
|
||||
URL url = new URL("jar", null, 0, jarFile.toURI().toURL().toString() + "!/", handler);
|
||||
URL url = new URL("jar", null, 0, jarFile.toURI().toURL() + "!/", handler);
|
||||
try {
|
||||
new StaticResourceJars().getUrlsFrom(url);
|
||||
assertThatNoException()
|
||||
@@ -110,7 +110,7 @@ class StaticResourceJarsTests {
|
||||
void closesJarFromNonCachedConnection() throws Exception {
|
||||
File jarFile = createResourcesJar("test-resources.jar");
|
||||
TrackedURLStreamHandler handler = new TrackedURLStreamHandler(false);
|
||||
URL url = new URL("jar", null, 0, jarFile.toURI().toURL().toString() + "!/", handler);
|
||||
URL url = new URL("jar", null, 0, jarFile.toURI().toURL() + "!/", handler);
|
||||
new StaticResourceJars().getUrlsFrom(url);
|
||||
assertThatIllegalStateException()
|
||||
.isThrownBy(() -> ((JarURLConnection) handler.getConnection()).getJarFile().getComment())
|
||||
|
||||
Reference in New Issue
Block a user