You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/03/01 10:22:58 UTC

[camel] 03/07: CAMEL-16274 - Camel-google-storage: serviceAccountKey should be supported as file, classpath, remote etc.

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit b9e137417e8f9b983f9680d2fcb6f7bd58becebc
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 1 09:30:30 2021 +0100

    CAMEL-16274 - Camel-google-storage: serviceAccountKey should be supported as file, classpath, remote etc.
---
 .../storage/integration/ComplexIntegrationTest.java      | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/components/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIntegrationTest.java b/components/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIntegrationTest.java
index 30b7aa4..3fa6a8c 100644
--- a/components/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIntegrationTest.java
+++ b/components/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIntegrationTest.java
@@ -64,12 +64,12 @@ public class ComplexIntegrationTest extends CamelTestSupport {
                             exchange.getIn().setHeader(GoogleCloudStorageConstants.OBJECT_NAME, filename);
                             exchange.getIn().setBody(bais);
                         })
-                        .to("google-storage://" + bucket1 + "?serviceAccountKey=" + serviceAccountKeyFile)
+                        .to("google-storage://" + bucket1 + "?serviceAccountKey=file:" + serviceAccountKeyFile)
                         .log("upload file object:${header.CamelGoogleCloudStorageObjectName}, body:${body}")
                         .to("mock:bucket1");
 
                 //poll from bucket1, moving processed into bucket_processed and deleting original
-                from("google-storage://" + bucket1 + "?serviceAccountKey=" + serviceAccountKeyFile
+                from("google-storage://" + bucket1 + "?serviceAccountKey=file:" + serviceAccountKeyFile
                      + "&moveAfterRead=true"
                      + "&destinationBucket=" + bucket3
                      + "&autoCreateBucket=true"
@@ -81,25 +81,25 @@ public class ComplexIntegrationTest extends CamelTestSupport {
 
                 //upload these files to bucket2 
                 from("direct:processed")
-                        .to("google-storage://" + bucket2 + "?serviceAccountKey=" + serviceAccountKeyFile)
+                        .to("google-storage://" + bucket2 + "?serviceAccountKey=file:" + serviceAccountKeyFile)
                         .log("uploaded file object:${header.CamelGoogleCloudStorageObjectName}, body:${body}")
                         .process(exchange -> {
                             exchange.getIn().setHeader(GoogleCloudStorageConstants.DOWNLOAD_LINK_EXPIRATION_TIME, 86400000L); //1 day
                         })
-                        .to("google-storage://" + bucket2 + "?serviceAccountKey=" + serviceAccountKeyFile
+                        .to("google-storage://" + bucket2 + "?serviceAccountKey=file:" + serviceAccountKeyFile
                             + "&operation=createDownloadLink")
                         .log("URL for ${header.CamelGoogleCloudStorageBucketName}/${header.CamelGoogleCloudStorageObjectName} =${body}")
                         .to("mock:bucket2");
 
                 //list all buckets
                 from("timer:timer1?repeatCount=1&fixedRate=true&period=10000")
-                        .to("google-storage://" + bucket2 + "?serviceAccountKey=" + serviceAccountKeyFile
+                        .to("google-storage://" + bucket2 + "?serviceAccountKey=file:" + serviceAccountKeyFile
                             + "&operation=listBuckets")
                         .log("list buckets:${body}");
 
                 //list all object of the bucket2 and send result to direct:moreinfo and direct:copy
                 from("timer:timer1?repeatCount=1&fixedRate=true&period=10000")
-                        .to("google-storage://" + bucket2 + "?serviceAccountKey=" + serviceAccountKeyFile
+                        .to("google-storage://" + bucket2 + "?serviceAccountKey=file:" + serviceAccountKeyFile
                             + "&operation=listObjects")
                         .log("list " + bucket2 + " objects body:${body}")
                         .split(bodyAs(List.class))
@@ -112,7 +112,7 @@ public class ComplexIntegrationTest extends CamelTestSupport {
                             String fileName = blob.getName();
                             exchange.getIn().setHeader(GoogleCloudStorageConstants.OBJECT_NAME, fileName);
                         })
-                        .to("google-storage://" + bucket2 + "?serviceAccountKey=" + serviceAccountKeyFile
+                        .to("google-storage://" + bucket2 + "?serviceAccountKey=file:" + serviceAccountKeyFile
                             + "&operation=getObject")
                         .log("get object bucket:${header.CamelGoogleCloudStorageBucketName} object:${header.CamelGoogleCloudStorageObjectName}, body:${body}");
 
@@ -126,7 +126,7 @@ public class ComplexIntegrationTest extends CamelTestSupport {
                             exchange.getIn().setHeader(GoogleCloudStorageConstants.DESTINATION_BUCKET_NAME, bucket4);
                             exchange.getIn().setHeader(GoogleCloudStorageConstants.DESTINATION_OBJECT_NAME, copyFileName);
                         })
-                        .to("google-storage://" + bucket2 + "?serviceAccountKey=" + serviceAccountKeyFile
+                        .to("google-storage://" + bucket2 + "?serviceAccountKey=file:" + serviceAccountKeyFile
                             + "&operation=copyObject")
                         .log("${body}");