This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 3.33.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/3.33.x by this push:
new e0fa3aef9e fix: use x509 certificates for ftp extensions sftp tests
e0fa3aef9e is described below
commit e0fa3aef9e485053298693181e4862ccf608e929
Author: Gaƫlle Fournier <[email protected]>
AuthorDate: Mon Jul 20 09:57:47 2026 +0200
fix: use x509 certificates for ftp extensions sftp tests
---
.../camel/quarkus/component/sftp/it/SftpResource.java | 12 ++++++------
.../apache/camel/quarkus/component/sftp/it/SftpTest.java | 16 +++++++++-------
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git
a/integration-tests/ftp/src/main/java/org/apache/camel/quarkus/component/sftp/it/SftpResource.java
b/integration-tests/ftp/src/main/java/org/apache/camel/quarkus/component/sftp/it/SftpResource.java
index 0a890acd93..97f8237c1c 100644
---
a/integration-tests/ftp/src/main/java/org/apache/camel/quarkus/component/sftp/it/SftpResource.java
+++
b/integration-tests/ftp/src/main/java/org/apache/camel/quarkus/component/sftp/it/SftpResource.java
@@ -120,13 +120,13 @@ public class SftpResource {
String.class);
}
- @Path("/certificateFile/create/{fileName}")
+ @Path("/privateKeyFile/create/{fileName}")
@POST
@Consumes(MediaType.TEXT_PLAIN)
- public Response createFileWithCertificateFile(@PathParam("fileName")
String fileName, String fileContent)
+ public Response createFileWithPrivateKeyFile(@PathParam("fileName") String
fileName, String fileContent)
throws Exception {
producerTemplate.sendBodyAndHeader(
-
"sftp://admin@localhost:{{camel.sftp.test-port}}/sftp?privateKeyFile=target/classes/certs/test-key-rsa.key&certFile=target/classes/certs/test-key-rsa-cert.pub",
+
"sftp://admin@localhost:{{camel.sftp.test-port}}/sftp?privateKeyFile=target/certs/sftp-auth.key",
fileContent,
Exchange.FILE_NAME, fileName);
return Response
@@ -134,12 +134,12 @@ public class SftpResource {
.build();
}
- @Path("/certificateFile/get/{fileName}")
+ @Path("/privateKeyFile/get/{fileName}")
@GET
@Produces(MediaType.TEXT_PLAIN)
- public String getFileWithCertificateFile(@PathParam("fileName") String
fileName) {
+ public String getFileWithPrivateKeyFile(@PathParam("fileName") String
fileName) {
return consumerTemplate.receiveBody(
-
"sftp://admin@localhost:{{camel.sftp.test-port}}/sftp?privateKeyFile=target/classes/certs/test-key-rsa.key&certFile=target/classes/certs/test-key-rsa-cert.pub&localWorkDirectory=target&fileName="
+
"sftp://admin@localhost:{{camel.sftp.test-port}}/sftp?privateKeyFile=target/certs/sftp-auth.key&localWorkDirectory=target&fileName="
+ fileName,
TIMEOUT_MS,
String.class);
diff --git
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTest.java
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTest.java
index 9d6186e9f7..647d61fbc3 100644
---
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTest.java
+++
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTest.java
@@ -33,7 +33,9 @@ import static org.hamcrest.CoreMatchers.is;
@Certificate(name = "ftp", formats = {
Format.PEM }, password = "password"),
@Certificate(name = "ftp", formats = {
- Format.PKCS12 }, password = "password") })
+ Format.PKCS12 }, password = "password"),
+ @Certificate(name = "sftp-auth", formats = {
+ Format.PEM }, password = "") })
@QuarkusTest
@QuarkusTestResource(SftpTestResource.class)
class SftpTest {
@@ -104,20 +106,20 @@ class SftpTest {
@Test
@DisabledIfFipsMode
- void testCertificateAuthenticationWithFile() {
+ void testPrivateKeyFileAuthentication() {
RestAssured.given()
.contentType(ContentType.TEXT)
- .body("Certificate file authentication test")
- .post("/sftp/certificateFile/create/certificate-file-test.txt")
+ .body("Private key file authentication test")
+ .post("/sftp/privateKeyFile/create/private-key-file-test.txt")
.then()
.statusCode(201);
- RestAssured.get("/sftp/certificateFile/get/certificate-file-test.txt")
+ RestAssured.get("/sftp/privateKeyFile/get/private-key-file-test.txt")
.then()
.statusCode(200)
- .body(is("Certificate file authentication test"));
+ .body(is("Private key file authentication test"));
- RestAssured.delete("/sftp/delete/certificate-file-test.txt")
+ RestAssured.delete("/sftp/delete/private-key-file-test.txt")
.then()
.statusCode(204);
}