From 21bdd04d8027ca7bc57231bc5a93dc404d6f2938 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 21 Mar 2022 13:10:42 +0100 Subject: [PATCH] Reset discoverer after directory based test --- wkd-java-cli/src/main/java/pgp/wkd/cli/command/Fetch.java | 4 +++- .../java/pgp/wkd/cli/test_suite/TestSuiteTestRunner.java | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/wkd-java-cli/src/main/java/pgp/wkd/cli/command/Fetch.java b/wkd-java-cli/src/main/java/pgp/wkd/cli/command/Fetch.java index eff5424..91d008e 100644 --- a/wkd-java-cli/src/main/java/pgp/wkd/cli/command/Fetch.java +++ b/wkd-java-cli/src/main/java/pgp/wkd/cli/command/Fetch.java @@ -39,9 +39,11 @@ public class Fetch implements Runnable { ) boolean armor = false; - private static CertificateDiscoverer discoverer = new DefaultCertificateDiscoverer( + public static final CertificateDiscoverer DEFAULT_DISCOVERER = new DefaultCertificateDiscoverer( new PGPainlessCertificateParser(), new HttpsUrlConnectionCertificateFetcher()); + private static CertificateDiscoverer discoverer = DEFAULT_DISCOVERER; + @Override public void run() { diff --git a/wkd-java-cli/src/test/java/pgp/wkd/cli/test_suite/TestSuiteTestRunner.java b/wkd-java-cli/src/test/java/pgp/wkd/cli/test_suite/TestSuiteTestRunner.java index 4130fde..04c4951 100644 --- a/wkd-java-cli/src/test/java/pgp/wkd/cli/test_suite/TestSuiteTestRunner.java +++ b/wkd-java-cli/src/test/java/pgp/wkd/cli/test_suite/TestSuiteTestRunner.java @@ -4,6 +4,7 @@ package pgp.wkd.cli.test_suite; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.TestFactory; @@ -70,4 +71,9 @@ public class TestSuiteTestRunner { } }); } + + @AfterAll + public static void reset() { + Fetch.setCertificateDiscoverer(Fetch.DEFAULT_DISCOVERER); + } }