This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit c984b42e3cb48958d2792cffd23f32200a58fcc7 Author: Andrea Cosentino <[email protected]> AuthorDate: Tue Mar 1 14:34:55 2022 +0100 CAMEL-17684 - Support ability to load properties from Vault/Secrets cloud services - GCP Secrets Manager --- .../GoogleSecretManagerPropertiesSourceTestIT.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java index 473cbbd..4253ba9 100644 --- a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java +++ b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesSourceTestIT.java @@ -48,6 +48,26 @@ public class GoogleSecretManagerPropertiesSourceTestIT extends CamelTestSupport @EnabledIfEnvironmentVariable(named = "CAMEL_VAULT_GCP_SERVICE_ACCOUNT_KEY", matches = ".*") @EnabledIfEnvironmentVariable(named = "CAMEL_VAULT_GCP_PROJECT_ID", matches = ".*") @Test + public void testComplexPropertiesFunction() throws Exception { + context.addRoutes(new RouteBuilder() { + @Override + public void configure() throws Exception { + from("direct:username").setBody(simple("{{gcp:database_sample/username}}")).to("mock:bar"); + from("direct:password").setBody(simple("{{gcp:database_sample/password}}")).to("mock:bar"); + } + }); + context.start(); + + getMockEndpoint("mock:bar").expectedBodiesReceived("admin", "password123"); + + template.sendBody("direct:username", "Hello World"); + template.sendBody("direct:password", "Hello World"); + assertMockEndpointsSatisfied(); + } + + @EnabledIfEnvironmentVariable(named = "CAMEL_VAULT_GCP_SERVICE_ACCOUNT_KEY", matches = ".*") + @EnabledIfEnvironmentVariable(named = "CAMEL_VAULT_GCP_PROJECT_ID", matches = ".*") + @Test public void testSecretNotFoundFunction() throws Exception { Exception exception = assertThrows(FailedToCreateRouteException.class, () -> { context.addRoutes(new RouteBuilder() {
