This is an automated email from the ASF dual-hosted git repository.
apupier pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new cc2c0827b133 CAMEL-25881: camel-mina-sftp - fix flaky
FromSftpRecursiveNotStepwiseNoBasePathIT
cc2c0827b133 is described below
commit cc2c0827b1338f1c3bfe648f183831e723fdaca7
Author: Aurélien Pupier <[email protected]>
AuthorDate: Mon Nov 9 11:19:53 2026 +0100
CAMEL-25881: camel-mina-sftp - fix flaky
FromSftpRecursiveNotStepwiseNoBasePathIT
Avoid cross-test interference in shared JVM test execution by making
SftpEmbeddedService an instance field instead of a static field.
Remove arbitrary initialDelay=3000 from the SFTP URI, configure the
consumer route with autoStartup(false), and explicitly start it after preparing
the test files and mock expectations.
Co-authored-by: IBM Bob 2.2.1
Signed-off-by: Aurélien Pupier <[email protected]>
---
.../mina/sftp/FromSftpRecursiveNotStepwiseNoBasePathIT.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git
a/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/sftp/FromSftpRecursiveNotStepwiseNoBasePathIT.java
b/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/sftp/FromSftpRecursiveNotStepwiseNoBasePathIT.java
index ff126cb6978a..f0f36dfefc5f 100644
---
a/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/sftp/FromSftpRecursiveNotStepwiseNoBasePathIT.java
+++
b/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/sftp/FromSftpRecursiveNotStepwiseNoBasePathIT.java
@@ -27,10 +27,10 @@ import org.junit.jupiter.api.extension.RegisterExtension;
public class FromSftpRecursiveNotStepwiseNoBasePathIT extends
BaseServerTestSupport {
@RegisterExtension
- protected static SftpEmbeddedService service = new
SftpEmbeddedService(true);
+ protected SftpEmbeddedService service = new SftpEmbeddedService(true);
protected String getSftpUrl() {
- return
"mina-sftp://admin@localhost:{{ftp.server.port}}?password=admin&initialDelay=3000&stepwise=false"
+ return
"mina-sftp://admin@localhost:{{ftp.server.port}}?password=admin&stepwise=false"
+ "&recursive=true&knownHostsFile=" +
service.getKnownHostsFile();
}
@@ -46,6 +46,9 @@ public class FromSftpRecursiveNotStepwiseNoBasePathIT extends
BaseServerTestSupp
// CAMEL-13400
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceivedInAnyOrder("Bye World", "Hello World",
"Goodday World");
+
+ context.getRouteController().startRoute("sftpConsumerRoute");
+
MockEndpoint.assertIsSatisfied(context);
}
@@ -54,7 +57,8 @@ public class FromSftpRecursiveNotStepwiseNoBasePathIT extends
BaseServerTestSupp
return new RouteBuilder() {
@Override
public void configure() {
-
from(getSftpUrl()).convertBodyTo(String.class).to("mock:result");
+
from(getSftpUrl()).routeId("sftpConsumerRoute").autoStartup(false).convertBodyTo(String.class)
+ .to("mock:result");
}
};
}