You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2026/07/12 20:05:51 UTC
(camel) branch main updated: CAMEL-24026: Fix flaky XsltFromFileExceptionTest (#24625)
This is an automated email from the ASF dual-hosted git repository.
gnodet 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 1f8808cc848e CAMEL-24026: Fix flaky XsltFromFileExceptionTest (#24625)
1f8808cc848e is described below
commit 1f8808cc848e83c2a6fd0a5e320bb3534dce0ca0
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Sun Jul 12 22:05:44 2026 +0200
CAMEL-24026: Fix flaky XsltFromFileExceptionTest (#24625)
CAMEL-24026: Fix flaky XsltFromFileExceptionTest
Co-authored-by: Claude Opus 4.6 <no...@anthropic.com>
---
.../camel/component/xslt/XsltFromFileExceptionTest.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/xslt/XsltFromFileExceptionTest.java b/core/camel-core/src/test/java/org/apache/camel/component/xslt/XsltFromFileExceptionTest.java
index 74f68c9e1a3f..dab9fc2d9b5f 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/xslt/XsltFromFileExceptionTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/xslt/XsltFromFileExceptionTest.java
@@ -21,6 +21,8 @@ import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
/**
*
*/
@@ -33,9 +35,10 @@ public class XsltFromFileExceptionTest extends ContextTestSupport {
template.sendBodyAndHeader(fileUri(), "<hello>world!</hello>", Exchange.FILE_NAME, "hello.xml");
- assertMockEndpointsSatisfied();
+ // wait for the file consumer to pick up and process the file before asserting
+ assertTrue(oneExchangeDone.matchesWaitTime(), "Exchange should have completed");
- oneExchangeDone.matchesWaitTime();
+ assertMockEndpointsSatisfied();
assertFileNotExists(testFile("hello.xml"));
assertFileExists(testFile("ok/hello.xml"));
@@ -49,9 +52,10 @@ public class XsltFromFileExceptionTest extends ContextTestSupport {
// the last tag is not ended properly
template.sendBodyAndHeader(fileUri(), "<hello>world!</hello", Exchange.FILE_NAME, "hello2.xml");
- assertMockEndpointsSatisfied();
+ // wait for the file consumer to pick up and process the file before asserting
+ assertTrue(oneExchangeDone.matchesWaitTime(), "Exchange should have completed");
- oneExchangeDone.matchesWaitTime();
+ assertMockEndpointsSatisfied();
assertFileNotExists(testFile("hello2.xml"));
assertFileExists(testFile("error/hello2.xml"));