You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/09/07 13:04:24 UTC

[camel] 02/02: (chores) camel-ftp: cleanup creating test service instances

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a72fff7bc926976775fd693a300ffb4ab04fddfd
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Wed Sep 7 13:53:02 2022 +0200

    (chores) camel-ftp: cleanup creating test service instances
---
 .../file/remote/integration/FtpPollEnrichBridgeErrorHandlerIT.java   | 3 ++-
 .../component/file/remote/integration/FtpServerTestSupport.java      | 3 ++-
 .../integration/FtpsServerExplicitSSLWithClientAuthTestSupport.java  | 4 +++-
 .../FtpsServerExplicitSSLWithoutClientAuthTestSupport.java           | 5 ++++-
 .../integration/FtpsServerExplicitTLSWithClientAuthTestSupport.java  | 5 ++++-
 .../FtpsServerExplicitTLSWithoutClientAuthTestSupport.java           | 5 ++++-
 .../integration/FtpsServerImplicitSSLWithClientAuthTestSupport.java  | 5 ++++-
 .../FtpsServerImplicitSSLWithoutClientAuthTestSupport.java           | 5 ++++-
 .../integration/FtpsServerImplicitTLSWithClientAuthTestSupport.java  | 5 ++++-
 .../FtpsServerImplicitTLSWithoutClientAuthTestSupport.java           | 5 ++++-
 10 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpPollEnrichBridgeErrorHandlerIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpPollEnrichBridgeErrorHandlerIT.java
index 6d54fe33b68..481df1b6b73 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpPollEnrichBridgeErrorHandlerIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpPollEnrichBridgeErrorHandlerIT.java
@@ -21,6 +21,7 @@ import org.apache.camel.Exchange;
 import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.file.remote.BaseServerTestSupport;
+import org.apache.camel.test.infra.ftp.services.FtpServiceFactory;
 import org.apache.camel.test.infra.ftp.services.embedded.FtpEmbeddedService;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
@@ -30,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 public class FtpPollEnrichBridgeErrorHandlerIT extends BaseServerTestSupport {
     @RegisterExtension
-    static FtpEmbeddedService service = new FtpEmbeddedService();
+    static FtpEmbeddedService service = FtpServiceFactory.createEmbeddedService();
 
     // we want to poll enrich from FTP and therefore want to fail fast if
     // something is wrong
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpServerTestSupport.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpServerTestSupport.java
index 6c8de2f56fa..ad0156d9603 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpServerTestSupport.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpServerTestSupport.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.file.remote.integration;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.component.file.remote.BaseServerTestSupport;
+import org.apache.camel.test.infra.ftp.services.FtpServiceFactory;
 import org.apache.camel.test.infra.ftp.services.embedded.FtpEmbeddedService;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
@@ -29,7 +30,7 @@ import static org.apache.camel.language.simple.SimpleLanguage.simple;
 public abstract class FtpServerTestSupport extends BaseServerTestSupport {
 
     @RegisterExtension
-    public FtpEmbeddedService service = new FtpEmbeddedService();
+    public FtpEmbeddedService service = FtpServiceFactory.createEmbeddedService();
 
     public void sendFile(String url, Object body, String fileName) {
         template.sendBodyAndHeader(url, body, Exchange.FILE_NAME, simple(fileName));
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitSSLWithClientAuthTestSupport.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitSSLWithClientAuthTestSupport.java
index 583c2797e42..b2604bc2829 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitSSLWithClientAuthTestSupport.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitSSLWithClientAuthTestSupport.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.file.remote.integration;
 
+import org.apache.camel.test.infra.ftp.services.embedded.EmbeddedConfiguration;
 import org.apache.camel.test.infra.ftp.services.embedded.FtpsEmbeddedService;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
@@ -25,7 +26,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
 public abstract class FtpsServerExplicitSSLWithClientAuthTestSupport extends FtpsServerTestSupport {
 
     @RegisterExtension
-    static FtpsEmbeddedService service = new FtpsEmbeddedService(false, AUTH_VALUE_SSL, true);
+    static FtpsEmbeddedService service
+            = new FtpsEmbeddedService(new EmbeddedConfiguration.SecurityConfiguration(false, AUTH_VALUE_SSL, true));
 
     @Deprecated
     public static int getPort() {
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitSSLWithoutClientAuthTestSupport.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitSSLWithoutClientAuthTestSupport.java
index 85cbfdce43f..3bfb383ec1e 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitSSLWithoutClientAuthTestSupport.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitSSLWithoutClientAuthTestSupport.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.file.remote.integration;
 
+import org.apache.camel.test.infra.ftp.services.FtpServiceFactory;
+import org.apache.camel.test.infra.ftp.services.embedded.EmbeddedConfiguration;
 import org.apache.camel.test.infra.ftp.services.embedded.FtpsEmbeddedService;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
@@ -25,7 +27,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
 public abstract class FtpsServerExplicitSSLWithoutClientAuthTestSupport extends FtpsServerTestSupport {
 
     @RegisterExtension
-    static FtpsEmbeddedService service = new FtpsEmbeddedService(false, AUTH_VALUE_SSL, false);
+    static FtpsEmbeddedService service = FtpServiceFactory
+            .createSecureEmbeddedService(new EmbeddedConfiguration.SecurityConfiguration(false, AUTH_VALUE_SSL, false));
 
     @Deprecated
     public static int getPort() {
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitTLSWithClientAuthTestSupport.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitTLSWithClientAuthTestSupport.java
index 42c7aa18198..cd11d647dff 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitTLSWithClientAuthTestSupport.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitTLSWithClientAuthTestSupport.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.file.remote.integration;
 
+import org.apache.camel.test.infra.ftp.services.FtpServiceFactory;
+import org.apache.camel.test.infra.ftp.services.embedded.EmbeddedConfiguration;
 import org.apache.camel.test.infra.ftp.services.embedded.FtpsEmbeddedService;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
@@ -25,7 +27,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
 public abstract class FtpsServerExplicitTLSWithClientAuthTestSupport extends FtpsServerTestSupport {
 
     @RegisterExtension
-    static FtpsEmbeddedService service = new FtpsEmbeddedService(false, AUTH_VALUE_TLS, true);
+    static FtpsEmbeddedService service = FtpServiceFactory
+            .createSecureEmbeddedService(new EmbeddedConfiguration.SecurityConfiguration(false, AUTH_VALUE_TLS, true));
 
     @Deprecated
     public static int getPort() {
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitTLSWithoutClientAuthTestSupport.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitTLSWithoutClientAuthTestSupport.java
index a248292a969..40dca1b129f 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitTLSWithoutClientAuthTestSupport.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerExplicitTLSWithoutClientAuthTestSupport.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.file.remote.integration;
 
+import org.apache.camel.test.infra.ftp.services.FtpServiceFactory;
+import org.apache.camel.test.infra.ftp.services.embedded.EmbeddedConfiguration;
 import org.apache.camel.test.infra.ftp.services.embedded.FtpsEmbeddedService;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
@@ -24,5 +26,6 @@ import org.junit.jupiter.api.extension.RegisterExtension;
  */
 public abstract class FtpsServerExplicitTLSWithoutClientAuthTestSupport extends FtpsServerTestSupport {
     @RegisterExtension
-    static FtpsEmbeddedService service = new FtpsEmbeddedService(false, AUTH_VALUE_TLS, false);
+    static FtpsEmbeddedService service = FtpServiceFactory
+            .createSecureEmbeddedService(new EmbeddedConfiguration.SecurityConfiguration(false, AUTH_VALUE_TLS, false));
 }
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitSSLWithClientAuthTestSupport.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitSSLWithClientAuthTestSupport.java
index c638a423be8..3b5599c2a88 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitSSLWithClientAuthTestSupport.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitSSLWithClientAuthTestSupport.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.file.remote.integration;
 
+import org.apache.camel.test.infra.ftp.services.FtpServiceFactory;
+import org.apache.camel.test.infra.ftp.services.embedded.EmbeddedConfiguration;
 import org.apache.camel.test.infra.ftp.services.embedded.FtpsEmbeddedService;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
@@ -24,7 +26,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
  */
 public abstract class FtpsServerImplicitSSLWithClientAuthTestSupport extends FtpsServerTestSupport {
     @RegisterExtension
-    static FtpsEmbeddedService service = new FtpsEmbeddedService(true, AUTH_VALUE_SSL, true);
+    static FtpsEmbeddedService service = FtpServiceFactory
+            .createSecureEmbeddedService(new EmbeddedConfiguration.SecurityConfiguration(true, AUTH_VALUE_SSL, true));
 
     @Deprecated
     public static int getPort() {
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitSSLWithoutClientAuthTestSupport.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitSSLWithoutClientAuthTestSupport.java
index 34560fc44d0..1e474130d29 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitSSLWithoutClientAuthTestSupport.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitSSLWithoutClientAuthTestSupport.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.file.remote.integration;
 
+import org.apache.camel.test.infra.ftp.services.FtpServiceFactory;
+import org.apache.camel.test.infra.ftp.services.embedded.EmbeddedConfiguration;
 import org.apache.camel.test.infra.ftp.services.embedded.FtpsEmbeddedService;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
@@ -24,7 +26,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
  */
 public abstract class FtpsServerImplicitSSLWithoutClientAuthTestSupport extends FtpsServerTestSupport {
     @RegisterExtension
-    static FtpsEmbeddedService service = new FtpsEmbeddedService(true, AUTH_VALUE_SSL, false);
+    static FtpsEmbeddedService service = FtpServiceFactory
+            .createSecureEmbeddedService(new EmbeddedConfiguration.SecurityConfiguration(true, AUTH_VALUE_SSL, false));
 
     @Deprecated
     public static int getPort() {
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitTLSWithClientAuthTestSupport.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitTLSWithClientAuthTestSupport.java
index 1512d5a4a37..9deb7607d02 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitTLSWithClientAuthTestSupport.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitTLSWithClientAuthTestSupport.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.file.remote.integration;
 
+import org.apache.camel.test.infra.ftp.services.FtpServiceFactory;
+import org.apache.camel.test.infra.ftp.services.embedded.EmbeddedConfiguration;
 import org.apache.camel.test.infra.ftp.services.embedded.FtpsEmbeddedService;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
@@ -24,7 +26,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
  */
 public abstract class FtpsServerImplicitTLSWithClientAuthTestSupport extends FtpsServerTestSupport {
     @RegisterExtension
-    static FtpsEmbeddedService service = new FtpsEmbeddedService(true, AUTH_VALUE_TLS, true);
+    static FtpsEmbeddedService service = FtpServiceFactory
+            .createSecureEmbeddedService(new EmbeddedConfiguration.SecurityConfiguration(true, AUTH_VALUE_TLS, true));
 
     @Deprecated
     public static int getPort() {
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitTLSWithoutClientAuthTestSupport.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitTLSWithoutClientAuthTestSupport.java
index ce2e1dbbf2b..c6c37ce3373 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitTLSWithoutClientAuthTestSupport.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpsServerImplicitTLSWithoutClientAuthTestSupport.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.file.remote.integration;
 
+import org.apache.camel.test.infra.ftp.services.FtpServiceFactory;
+import org.apache.camel.test.infra.ftp.services.embedded.EmbeddedConfiguration;
 import org.apache.camel.test.infra.ftp.services.embedded.FtpsEmbeddedService;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
@@ -25,7 +27,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
 public abstract class FtpsServerImplicitTLSWithoutClientAuthTestSupport extends FtpsServerTestSupport {
 
     @RegisterExtension
-    static FtpsEmbeddedService service = new FtpsEmbeddedService(true, AUTH_VALUE_TLS, false);
+    static FtpsEmbeddedService service = FtpServiceFactory
+            .createSecureEmbeddedService(new EmbeddedConfiguration.SecurityConfiguration(true, AUTH_VALUE_TLS, false));
 
     @Deprecated
     public static int getPort() {