From 665a127448c43d9861360388a19187b0cbc10e8b Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Fri, 8 May 2020 22:56:42 +0900 Subject: [PATCH] Fix JarFileTests.getInputStreamWhenClosed() See gh-21365 --- .../java/org/springframework/boot/loader/jar/JarFileTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarFileTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarFileTests.java index 34b17eb22d3..41455c825d2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarFileTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarFileTests.java @@ -193,8 +193,9 @@ class JarFileTests { @Test void getInputStreamWhenClosed() throws Exception { + ZipEntry entry = this.jarFile.getEntry("1.dat"); this.jarFile.close(); - assertThatZipFileClosedIsThrownBy(() -> this.jarFile.getInputStream(this.jarFile.getEntry("1.dat"))); + assertThatZipFileClosedIsThrownBy(() -> this.jarFile.getInputStream(entry)); } @Test