This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch camel-3.11.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.11.x by this push:
new f73a2b7 Camel-AWS2-S3: When includeBody is false, the message Body
should not be set
f73a2b7 is described below
commit f73a2b7d5b0f1c43ce9c1e5ab2512bc55fe2aeba
Author: Andrea Cosentino <[email protected]>
AuthorDate: Mon Oct 4 13:45:05 2021 +0200
Camel-AWS2-S3: When includeBody is false, the message Body should not be set
---
.../java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java | 2 --
.../component/aws2/s3/integration/S3ConsumerIncludeBodyIT.java | 6 +++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git
a/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java
b/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java
index c41bc78..d2d84e5 100644
---
a/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java
+++
b/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java
@@ -386,8 +386,6 @@ public class AWS2S3Consumer extends
ScheduledBatchPollingConsumer {
} catch (IOException e) {
throw new RuntimeCamelException(e);
}
- } else {
- message.setBody(s3Object);
}
}
diff --git
a/components/camel-aws/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3ConsumerIncludeBodyIT.java
b/components/camel-aws/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3ConsumerIncludeBodyIT.java
index 8c63f6b..2772d07 100644
---
a/components/camel-aws/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3ConsumerIncludeBodyIT.java
+++
b/components/camel-aws/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3ConsumerIncludeBodyIT.java
@@ -26,7 +26,7 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
public class S3ConsumerIncludeBodyIT extends Aws2S3Base {
@@ -69,7 +69,7 @@ public class S3ConsumerIncludeBodyIT extends Aws2S3Base {
assertMockEndpointsSatisfied();
assertEquals(3, result.getExchanges().size());
- assertNotNull(result.getExchanges().get(0).getMessage().getBody());
+ assertNull(result.getExchanges().get(0).getMessage().getBody());
}
@Override
@@ -79,7 +79,7 @@ public class S3ConsumerIncludeBodyIT extends Aws2S3Base {
public void configure() throws Exception {
String awsEndpoint = "aws2-s3://mycamel?autoCreateBucket=true";
-
from("direct:putObject").startupOrder(1).to(awsEndpoint).to("mock:result");
+ from("direct:putObject").startupOrder(1).to(awsEndpoint);
from("aws2-s3://mycamel?moveAfterRead=true&destinationBucket=camel-kafka-connector&autoCreateBucket=true&destinationBucketPrefix=RAW(movedPrefix)&destinationBucketSuffix=RAW(movedSuffix)&includeBody=false")
.startupOrder(2).to("mock:result");