From 7f9115df17f1bb7635a902435f4db37f1cfb1a0f Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Thu, 6 Aug 2026 18:46:10 +0200 Subject: [PATCH] CAMEL-24345: camel-google-vertexai - do not require credentials in GoogleVertexAIProducerOptionsTest The test resolved the endpoint from a started CamelContext, which starts the endpoint too, and starting it builds the Vertex AI client from Application Default Credentials. That passes on a workstation with ADC configured and fails everywhere else, including CI. The endpoint is now created through the component without being started, like in GoogleVertexAIProducerOperationsTest. The producer only reads the configuration in the methods under test. Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Andrea Cosentino --- .../google/vertexai/GoogleVertexAIProducerOptionsTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/camel-google/camel-google-vertexai/src/test/java/org/apache/camel/component/google/vertexai/GoogleVertexAIProducerOptionsTest.java b/components/camel-google/camel-google-vertexai/src/test/java/org/apache/camel/component/google/vertexai/GoogleVertexAIProducerOptionsTest.java index e3e7c74de94f1..061173366aed6 100644 --- a/components/camel-google/camel-google-vertexai/src/test/java/org/apache/camel/component/google/vertexai/GoogleVertexAIProducerOptionsTest.java +++ b/components/camel-google/camel-google-vertexai/src/test/java/org/apache/camel/component/google/vertexai/GoogleVertexAIProducerOptionsTest.java @@ -43,8 +43,10 @@ void tearDown() { private GoogleVertexAIProducer producer(String query) throws Exception { context = new DefaultCamelContext(); - context.start(); - GoogleVertexAIEndpoint endpoint = context.getEndpoint(BASE + query, GoogleVertexAIEndpoint.class); + // the endpoint is deliberately created without starting it: starting it builds the Vertex AI client, + // which looks up Application Default Credentials and fails wherever none are configured + GoogleVertexAIComponent component = context.getComponent("google-vertexai", GoogleVertexAIComponent.class); + GoogleVertexAIEndpoint endpoint = (GoogleVertexAIEndpoint) component.createEndpoint(BASE + query); return new GoogleVertexAIProducer(endpoint); }