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 5fd4dca  CAMEL-17478 camel-aws2-s3 Parameters (accessKey ,secretKey 
and region) are mandatory for downloadLink operation. (#6752)
5fd4dca is described below

commit 5fd4dca1f2ac26ac9c2697c9f2490192fc18d42e
Author: JiriOndrusek <ondrusek.j...@gmail.com>
AuthorDate: Fri Jan 14 17:38:36 2022 +0100

    CAMEL-17478 camel-aws2-s3 Parameters (accessKey ,secretKey and region) are 
mandatory for downloadLink operation. (#6752)
---
 .../camel-aws2-s3/src/main/docs/aws2-s3-component.adoc       |  2 +-
 .../aws2/s3/integration/S3CreateDownloadLinkOperationIT.java | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-aws/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc 
b/components/camel-aws/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
index 2f1a71d..048955b 100644
--- a/components/camel-aws/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
+++ b/components/camel-aws/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
@@ -395,7 +395,7 @@ This operation will return an S3Object instance related to 
the camelKey object i
 
--------------------------------------------------------------------------------
 
 This operation will return a download link url for the file camel-key in the 
bucket mycamelbucket and region region.
-Parameters (`accessKey`, `secretKey` and `region`)  are mandatory for this 
operation.
+Parameters (`accessKey`, `secretKey` and `region`) are mandatory for this 
operation, if S3 client is autowired from the registry.
 
 == Streaming Upload mode
 
diff --git 
a/components/camel-aws/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CreateDownloadLinkOperationIT.java
 
b/components/camel-aws/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CreateDownloadLinkOperationIT.java
index 268ef56..5dca122 100644
--- 
a/components/camel-aws/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CreateDownloadLinkOperationIT.java
+++ 
b/components/camel-aws/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CreateDownloadLinkOperationIT.java
@@ -28,6 +28,7 @@ import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.jupiter.api.Test;
 
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 
 public class S3CreateDownloadLinkOperationIT extends Aws2S3Base {
 
@@ -66,7 +67,16 @@ public class S3CreateDownloadLinkOperationIT extends 
Aws2S3Base {
             }
         });
 
+        Exchange ex2 = 
template.request("direct:createDownloadLinkWithoutCredentials", new Processor() 
{
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(AWS2S3Constants.KEY, 
"CamelUnitTest2");
+                exchange.getIn().setHeader(AWS2S3Constants.BUCKET_NAME, 
"mycamel2");
+                exchange.getIn().setHeader(AWS2S3Constants.S3_OPERATION, 
AWS2S3Operations.createDownloadLink);
+            }
+        });
+
         assertNotNull(ex1.getMessage().getBody());
+        assertNull(ex2.getMessage().getBody());
         assertMockEndpointsSatisfied();
     }
 
@@ -81,6 +91,8 @@ public class S3CreateDownloadLinkOperationIT extends 
Aws2S3Base {
 
                 from("direct:addObject").to(awsEndpoint);
 
+                
from("direct:createDownloadLinkWithoutCredentials").to(awsEndpoint).to("mock:result");
+
                 from("direct:createDownloadLink").to(awsEndpoint + 
"&accessKey=xxx&secretKey=yyy&region=eu-west-1")
                         .to("mock:result");
 

Reply via email to