From 85456cac15e80a90b6a4af319e02872cc204f819 Mon Sep 17 00:00:00 2001 From: Andrej Vano Date: Tue, 3 Sep 2024 11:44:45 +0200 Subject: [PATCH] [Tests] FTP: Use restrictions to bypass cert setup issues --- .../org/apache/camel/quarkus/component/ftp/it/FtpTest.java | 2 +- .../apache/camel/quarkus/component/ftps/it/FtpsTest.java | 2 +- .../camel/quarkus/component/ftps/it/FtpsTestResource.java | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftp/it/FtpTest.java b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftp/it/FtpTest.java index 88e4cd40832b..c6a5b91d1de5 100644 --- a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftp/it/FtpTest.java +++ b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftp/it/FtpTest.java @@ -25,7 +25,7 @@ import static org.hamcrest.CoreMatchers.is; @QuarkusTest -@QuarkusTestResource(FtpTestResource.class) +@QuarkusTestResource(value = FtpTestResource.class, restrictToAnnotatedClass = true) class FtpTest { @Test public void testFtpComponent() { diff --git a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTest.java b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTest.java index 753990d8fbaa..673aa66eedf1 100644 --- a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTest.java +++ b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTest.java @@ -34,7 +34,7 @@ Format.PKCS12 }, password = "password") }) @Disabled //https://github.com/apache/camel-quarkus/issues/4089 @QuarkusTest -@QuarkusTestResource(FtpsTestResource.class) +@QuarkusTestResource(value = FtpsTestResource.class, restrictToAnnotatedClass = true) class FtpsTest { static final String CERTIFICATE_KEYSTORE_FILE = CertificatesUtil.keystoreFile("ftp", "p12"); diff --git a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTestResource.java b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTestResource.java index 9181cb736dbd..ac4a4be31867 100644 --- a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTestResource.java +++ b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTestResource.java @@ -30,12 +30,6 @@ public FtpsTestResource() { @Override protected ListenerFactory createListenerFactory(int port) { - //do not create a factory if keystore file does not exists - //because the test is disabled, but the test resource is "activated", this condition prevents the failure - //for the FtpTest - if (!Path.of(FtpsTest.CERTIFICATE_KEYSTORE_FILE).toFile().exists()) { - return null; - } SslConfigurationFactory sslConfigFactory = new SslConfigurationFactory(); sslConfigFactory.setKeystoreFile(Path.of(FtpsTest.CERTIFICATE_KEYSTORE_FILE).toFile());