From 4d22c5fce947a49913cf3e3c0c4f79f5243d2672 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 9 Mar 2023 11:37:55 +0200 Subject: [PATCH] Properly close metadata file in integration tests Fixes: #31713 --- .../java/io/quarkus/test/junit/IntegrationTestUtil.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/IntegrationTestUtil.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/IntegrationTestUtil.java index 03887b8506485..aa4fed9028ffd 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/IntegrationTestUtil.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/IntegrationTestUtil.java @@ -433,9 +433,10 @@ static Properties readQuarkusArtifactProperties(ExtensionContext context) { } throw new IllegalStateException(errorMessage); } - try { - Properties properties = new Properties(); - properties.load(new FileInputStream(artifactProperties.toFile())); + + Properties properties = new Properties(); + try (var fis = new FileInputStream(artifactProperties.toFile())) { + properties.load(fis); return properties; } catch (IOException e) { throw new UncheckedIOException(