This is an automated email from the ASF dual-hosted git repository. davsclaus 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 77180bf7a58 CAMEL-21352: camel-smb - More stuff 77180bf7a58 is described below commit 77180bf7a58b8c35d0697bb377a4032eb42a6042 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Mon Jan 6 12:17:46 2025 +0100 CAMEL-21352: camel-smb - More stuff --- .../smb/SmbConsumerPartialReadNoPathIT.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbConsumerPartialReadNoPathIT.java b/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbConsumerPartialReadNoPathIT.java index 8b2698cdc18..49496800b84 100644 --- a/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbConsumerPartialReadNoPathIT.java +++ b/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbConsumerPartialReadNoPathIT.java @@ -21,6 +21,7 @@ import java.util.concurrent.TimeUnit; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.support.DefaultUuidGenerator; import org.junit.jupiter.api.Test; import static org.awaitility.Awaitility.await; @@ -28,29 +29,30 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class SmbConsumerPartialReadNoPathIT extends SmbServerTestSupport { + private final String uuid = new DefaultUuidGenerator().generateUuid() + ".txt";; + @Override public void doPostSetup() throws Exception { - template.sendBodyAndHeader(getSmbUrl(), "Hello World", Exchange.FILE_NAME, "hello.txt"); + template.sendBodyAndHeader(getSmbUrl(), "Hello Uuid", Exchange.FILE_NAME, uuid); } protected String getSmbUrl() { return String.format( - "smb:%s/%s?username=%s&password=%s&move=done&moveFailed=failed", - service.address(), service.shareName(), service.userName(), service.password()); + "smb:%s/%s?username=%s&password=%s&move=done&moveFailed=failed&searchPattern=%s", + service.address(), service.shareName(), service.userName(), service.password(), uuid); } @Test - public void testSmbSimpleConsumeAbsolute() throws Exception { + public void testSmbSimpleConsumeNoPath() throws Exception { MockEndpoint mock = getMockEndpoint("mock:result"); - mock.expectedBodiesReceived("Hello World"); - mock.expectedMessageCount(1); - mock.expectedHeaderReceived(Exchange.FILE_NAME, "hello.txt"); + mock.expectedBodiesReceived("Hello Uuid"); + mock.expectedHeaderReceived(Exchange.FILE_NAME, uuid); MockEndpoint.assertIsSatisfied(context); - await().atMost(3, TimeUnit.SECONDS) - .untilAsserted(() -> assertEquals("Hello World", - new String(copyFileContentFromContainer("/data/rw/failed/hello.txt")))); + await().atMost(5, TimeUnit.SECONDS) + .untilAsserted(() -> assertEquals("Hello Uuid", + new String(copyFileContentFromContainer("/data/rw/failed/" + uuid)))); } @Override