This is an automated email from the ASF dual-hosted git repository.
orpiske 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 f8d0683d15d (chores) camel-core: file test fixes and cleanups
f8d0683d15d is described below
commit f8d0683d15d0ad53e19478cb8a9c952f250e3167
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Mon Jul 17 14:07:57 2023 +0200
(chores) camel-core: file test fixes and cleanups
- adjust to send the messages earlier
- increase timeouts for reduced flakiness on slow hosts
---
.../apache/camel/component/file/FilePollEnrichNoWaitTest.java | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git
a/core/camel-core/src/test/java/org/apache/camel/component/file/FilePollEnrichNoWaitTest.java
b/core/camel-core/src/test/java/org/apache/camel/component/file/FilePollEnrichNoWaitTest.java
index b3f2f1dffd8..c5f3dc98e15 100644
---
a/core/camel-core/src/test/java/org/apache/camel/component/file/FilePollEnrichNoWaitTest.java
+++
b/core/camel-core/src/test/java/org/apache/camel/component/file/FilePollEnrichNoWaitTest.java
@@ -17,27 +17,32 @@
package org.apache.camel.component.file;
import java.nio.file.Files;
+import java.time.Duration;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
public class FilePollEnrichNoWaitTest extends ContextTestSupport {
+ @BeforeEach
+ public void sendMessage() {
+ template.sendBodyAndHeader(fileUri(), "Hello World",
Exchange.FILE_NAME, "hello.txt");
+ }
+
@Test
public void testFilePollEnrichNoWait() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceived("Hello World");
mock.expectedFileExists(testFile("done/hello.txt"));
- template.sendBodyAndHeader(fileUri(), "Hello World",
Exchange.FILE_NAME, "hello.txt");
-
- assertMockEndpointsSatisfied();
oneExchangeDone.matchesWaitTime();
+ mock.assertIsSatisfied(Duration.ofSeconds(2).toMillis());
// file should be moved
assertFalse(Files.exists(testFile("hello.txt")), "File should have
been moved");