jamesnetherton commented on code in PR #8421:
URL: https://github.com/apache/camel-quarkus/pull/8421#discussion_r2925241195
##########
integration-tests/mina-sftp/pom.xml:
##########
@@ -53,9 +57,65 @@
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
+
+ <!-- test dependencies - camel-quarkus -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-test-support</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-sftp</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- test dependencies - sftp -->
+ <dependency>
+ <groupId>org.apache.sshd</groupId>
+ <artifactId>sshd-sftp</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sshd</groupId>
+ <artifactId>sshd-scp</artifactId>
+ <scope>test</scope>
+ </dependency>
Review Comment:
Could probably be removed if they are transitives of
`camel-quarkus-integration-tests-support-sftp`.
##########
integration-tests/mina-sftp/src/test/java/org/apache/camel/quarkus/component/mina/sftp/it/MinaSftpTest.java:
##########
@@ -0,0 +1,235 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.mina.sftp.it;
+
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import io.smallrye.certs.Format;
+import io.smallrye.certs.junit5.Certificate;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
+import org.apache.camel.quarkus.test.support.sftp.SftpTestResource;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+
+@TestCertificates(certificates = {
+ @Certificate(name = "ftp", formats = {
+ Format.PEM }, password = ""),
+ @Certificate(name = "ftp-encrypted", formats = {
+ Format.PEM }, password = "password"),
+ @Certificate(name = "ftp", formats = {
+ Format.PKCS12 }, password = "password") })
+@QuarkusTest
+@QuarkusTestResource(SftpTestResource.class)
+class MinaSftpTest {
+
+ @Test
+ void loadComponentMinaSftp() {
+ /* A simple autogenerated test */
+ RestAssured.get("/mina-sftp/load/component/mina-sftp")
+ .then()
+ .statusCode(200);
+ }
+
+ @Test
+ public void testMinaSftpComponent() {
Review Comment:
Nitpick - for any new test classes I try to not use `public` modifier.
##########
extensions/mina-sftp/deployment/src/main/java/org/apache/camel/quarkus/component/mina/sftp/deployment/MinaSftpProcessor.java:
##########
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.mina.sftp.deployment;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import
io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import org.apache.camel.quarkus.core.deployment.spi.CamelServiceFilter;
+import
org.apache.camel.quarkus.core.deployment.spi.CamelServiceFilterBuildItem;
+
+class MinaSftpProcessor {
+
+ private static final String FEATURE = "camel-mina-sftp";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ void filterFtpComponents(BuildProducer<CamelServiceFilterBuildItem>
serviceFilter) {
+ // camel-mina-sftp depends on camel-ftp only for shared base classes
(RemoteFileEndpoint, etc.)
+ serviceFilter.produce(new
CamelServiceFilterBuildItem(CamelServiceFilter.forComponent("ftp")));
+ serviceFilter.produce(new
CamelServiceFilterBuildItem(CamelServiceFilter.forComponent("ftps")));
+ serviceFilter.produce(new
CamelServiceFilterBuildItem(CamelServiceFilter.forComponent("sftp")));
Review Comment:
Not sure if we should add a note to docs that `camel-quarkus-ftp` wont work
if added together with `camel-quarkus-mina-sftp`? It's a bit of an edge case.
WDYT?
##########
pom.xml:
##########
@@ -88,6 +88,7 @@
<commons-collections.version>${commons-collections-version}</commons-collections.version>
<commons-collections4.version>${commons-collections4-version}</commons-collections4.version>
<commons-exec.version>${commons-exec-version}</commons-exec.version>
+ <commons-net.version>3.12.0</commons-net.version><!-- @sync
org.apache.camel:camel-ftp:${camel.version} dep:commons-net:commons-net -->
Review Comment:
You can simplify and reference the property from the `camel-dependencies`
parent:
```suggestion
<commons-net.version>${commons-net-version}</commons-net.version>
```
--
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]