essobedo commented on code in PR #365:
URL: https://github.com/apache/camel-karaf/pull/365#discussion_r1644025891


##########
tests/features/camel-ftp/src/test/java/org/apache/karaf/camel/itest/FtpServerResource.java:
##########
@@ -0,0 +1,37 @@
+package org.apache.karaf.camel.itest;
+
+import java.util.Map;
+
+import org.apache.ftpserver.FtpServer;
+import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.karaf.camel.itests.ExternalResource;
+
+public class FtpServerResource implements ExternalResource {
+
+    private final FtpServer ftpServer;
+    private final int port;
+
+    public FtpServerResource(FtpServer server, int port) {
+        this.ftpServer = server;
+        this.port = port;
+    }
+
+    @Override
+    public void before() {
+        try {
+            ftpServer.start();
+        } catch (FtpException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @Override
+    public void after() {
+        ftpServer.stop();
+    }
+
+    @Override
+    public Map<String, String> properties() {
+        return Map.of("ftp.port",Integer.toString(port));

Review Comment:
   ```suggestion
           return Map.of("ftp.port", Integer.toString(port));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to