From 5d5844c6d4aba94bdb724b3f8689285ddc9364ff Mon Sep 17 00:00:00 2001 From: Clement Escoffier Date: Thu, 18 Jul 2024 13:59:22 +0200 Subject: [PATCH] Remove .env file generated during tests One unit tests from the TLS CLI is generating a .env file during its execution. This commit removes the file after the execution of the test. --- .../io/quarkus/tls/cli/SelfSignedGenerationTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/extensions/tls-registry/cli/src/test/java/io/quarkus/tls/cli/SelfSignedGenerationTest.java b/extensions/tls-registry/cli/src/test/java/io/quarkus/tls/cli/SelfSignedGenerationTest.java index c3a5b23aef4e4..6db2867cc3924 100644 --- a/extensions/tls-registry/cli/src/test/java/io/quarkus/tls/cli/SelfSignedGenerationTest.java +++ b/extensions/tls-registry/cli/src/test/java/io/quarkus/tls/cli/SelfSignedGenerationTest.java @@ -4,11 +4,21 @@ import java.io.FileInputStream; import java.security.KeyStore; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; public class SelfSignedGenerationTest { + @AfterAll + static void cleanup() { + // File generated during the generation. + File file = new File(".env"); + if (file.isFile()) { + file.delete(); + } + } + @Test public void testSelfSignedGeneration() throws Exception { GenerateCertificateCommand command = new GenerateCertificateCommand();