This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch camel-3.7.x in repository https://gitbox.apache.org/repos/asf/camel.git
commit 20b7bac9409d4c1888a281668ccfb829f39a8f38 Author: Andrea Cosentino <[email protected]> AuthorDate: Fri Feb 12 15:05:06 2021 +0100 CAMEL-16189 - AWS2S3Producer not setting serverside encryption values, improved the test with a getObject --- .../S3SimpleEncryptedUploadOperationLocalstackTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/localstack/S3SimpleEncryptedUploadOperationLocalstackTest.java b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/localstack/S3SimpleEncryptedUploadOperationLocalstackTest.java index e0e03e7..2625e16 100644 --- a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/localstack/S3SimpleEncryptedUploadOperationLocalstackTest.java +++ b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/localstack/S3SimpleEncryptedUploadOperationLocalstackTest.java @@ -39,9 +39,13 @@ public class S3SimpleEncryptedUploadOperationLocalstackTest extends Aws2S3BaseTe @EndpointInject("mock:result") private MockEndpoint result; + @EndpointInject("mock:resultGet") + private MockEndpoint resultGet; + @Test public void sendIn() throws Exception { result.expectedMessageCount(1); + resultGet.expectedMessageCount(1); template.send("direct:putObject", new Processor() { @@ -61,10 +65,21 @@ public class S3SimpleEncryptedUploadOperationLocalstackTest extends Aws2S3BaseTe } }); + Exchange c = template.request("direct:getObject", new Processor() { + + @Override + public void process(Exchange exchange) throws Exception { + exchange.getIn().setHeader(AWS2S3Constants.KEY, "camel.txt"); + exchange.getIn().setHeader(AWS2S3Constants.S3_OPERATION, AWS2S3Operations.getObject); + } + }); + List<S3Object> resp = result.getExchanges().get(0).getMessage().getBody(List.class); assertEquals(1, resp.size()); assertEquals("camel.txt", resp.get(0).key()); + assertEquals("Camel rocks!", c.getIn().getBody(String.class)); + assertMockEndpointsSatisfied(); } @@ -80,6 +95,8 @@ public class S3SimpleEncryptedUploadOperationLocalstackTest extends Aws2S3BaseTe from("direct:listObjects").to(awsEndpoint).to("mock:result"); + from("direct:getObject").to("aws2-s3://mycamel?autoCreateBucket=true").to("mock:resultGet"); + } }; }
