You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/10/17 07:41:09 UTC
[camel] branch main updated: CAMEL-18608: Fix the tests of type PollEnrichConsumeWithDisconnectAndDeleteIT
This is an automated email from the ASF dual-hosted git repository.
nfilotto 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 28097b64b80 CAMEL-18608: Fix the tests of type PollEnrichConsumeWithDisconnectAndDeleteIT
28097b64b80 is described below
commit 28097b64b805e778da87986c7491acbcab3d1e3e
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Mon Oct 17 09:40:37 2022 +0200
CAMEL-18608: Fix the tests of type PollEnrichConsumeWithDisconnectAndDeleteIT
---
.../FtpPollEnrichConsumeWithDisconnectAndDeleteIT.java | 11 ++++-------
.../SftpPollEnrichConsumeWithDisconnectAndDeleteIT.java | 9 +++++----
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpPollEnrichConsumeWithDisconnectAndDeleteIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpPollEnrichConsumeWithDisconnectAndDeleteIT.java
index f6fcbb96ced..b72472e2e1c 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpPollEnrichConsumeWithDisconnectAndDeleteIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/FtpPollEnrichConsumeWithDisconnectAndDeleteIT.java
@@ -24,18 +24,14 @@ import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import static org.awaitility.Awaitility.await;
import static org.junit.jupiter.api.Assertions.assertFalse;
-public class FtpPollEnrichConsumeWithDisconnectAndDeleteIT extends FtpServerTestSupport {
-
- private static final Logger LOG = LoggerFactory.getLogger(FtpPollEnrichConsumeWithDisconnectAndDeleteIT.class);
+class FtpPollEnrichConsumeWithDisconnectAndDeleteIT extends FtpServerTestSupport {
@Test
- public void testFtpSimpleConsume() throws Exception {
+ void testFtpSimpleConsume() throws Exception {
String expected = "Hello World";
// create file using regular file
@@ -49,7 +45,8 @@ public class FtpPollEnrichConsumeWithDisconnectAndDeleteIT extends FtpServerTest
ProducerTemplate triggerTemplate = context.createProducerTemplate();
triggerTemplate.sendBody("vm:trigger", "");
- MockEndpoint.assertIsSatisfied(context);
+ mock.setResultWaitTime(TimeUnit.MINUTES.toMillis(1));
+ mock.assertIsSatisfied();
File file = service.ftpFile("poll/hello.txt").toFile();
await().atMost(3, TimeUnit.SECONDS)
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/SftpPollEnrichConsumeWithDisconnectAndDeleteIT.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/SftpPollEnrichConsumeWithDisconnectAndDeleteIT.java
index b5c1823fa79..3f3807461a5 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/SftpPollEnrichConsumeWithDisconnectAndDeleteIT.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/integration/SftpPollEnrichConsumeWithDisconnectAndDeleteIT.java
@@ -32,10 +32,10 @@ import static org.awaitility.Awaitility.await;
import static org.junit.jupiter.api.Assertions.assertFalse;
@EnabledIf(value = "org.apache.camel.test.infra.ftp.services.embedded.SftpUtil#hasRequiredAlgorithms('src/test/resources/hostkey.pem')")
-public class SftpPollEnrichConsumeWithDisconnectAndDeleteIT extends SftpServerTestSupport {
- @Timeout(value = 30)
+class SftpPollEnrichConsumeWithDisconnectAndDeleteIT extends SftpServerTestSupport {
+ @Timeout(value = 60)
@Test
- public void testSftpSimpleConsume() throws Exception {
+ void testSftpSimpleConsume() throws Exception {
String expected = "Hello World";
// create file using regular file
@@ -49,7 +49,8 @@ public class SftpPollEnrichConsumeWithDisconnectAndDeleteIT extends SftpServerTe
ProducerTemplate triggerTemplate = context.createProducerTemplate();
triggerTemplate.sendBody("vm:trigger", "");
- MockEndpoint.assertIsSatisfied(context);
+ mock.setResultWaitTime(TimeUnit.MINUTES.toMillis(1));
+ mock.assertIsSatisfied();
File file = ftpFile("hello.txt").toFile();
await().atMost(3, TimeUnit.SECONDS)