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 cb2a81c84127 CAMEL-26622: camel-google-storage - fail fast when 
GOOGLE_APPLICATION_CREDENTIALS is set without the remote mode (#30281)
cb2a81c84127 is described below

commit cb2a81c841278d4b600f2277531de247b88dae98
Author: Andrea Cosentino <[email protected]>
AuthorDate: Tue Nov 17 16:07:10 2026 +0100

    CAMEL-26622: camel-google-storage - fail fast when 
GOOGLE_APPLICATION_CREDENTIALS is set without the remote mode (#30281)
    
    Follow-up of #29818. Since #29818 ComplexIT of camel-google-storage runs on
    Floci GCP unless -Dgoogle.instance.type=remote is given, so a run with
    GOOGLE_APPLICATION_CREDENTIALS set could be taken for a run against that
    project. As the Firestore, BigQuery and Secret Manager tests do, ComplexIT
    now fails fast in local mode when GOOGLE_APPLICATION_CREDENTIALS is set,
    with a message that asks for -Dgoogle.instance.type=remote.
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 .../camel/component/google/storage/integration/ComplexIT.java      | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIT.java
 
b/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIT.java
index d5a34f9e6bb5..5895f2f3056f 100644
--- 
a/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIT.java
+++ 
b/components/camel-google/camel-google-storage/src/test/java/org/apache/camel/component/google/storage/integration/ComplexIT.java
@@ -61,6 +61,13 @@ class ComplexIT extends CamelTestSupport {
     @Override
     protected void bindToRegistry(Registry registry) throws Exception {
         if (service instanceof GoogleStorageLocalContainerInfraService) {
+            // the test ran against a real project when this variable was set, 
before it ran on Floci GCP: so that a run
+            // on Floci GCP is not taken for one against that project, it asks 
for -Dgoogle.instance.type=remote
+            if (System.getenv("GOOGLE_APPLICATION_CREDENTIALS") != null) {
+                throw new IllegalStateException(
+                        "GOOGLE_APPLICATION_CREDENTIALS is set: add 
-Dgoogle.instance.type=remote to run the test against"
+                                                + " the Cloud Storage of that 
project");
+            }
             // the endpoints take the client of the registry; against Google 
Cloud, they build their own
             registry.bind("storageClient", createLocalStorageClient());
         }

Reply via email to