This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit bbc0c401893846bc1237a828dc86de9f75c55b25 Author: Otavio Rodolfo Piske <[email protected]> AuthorDate: Tue Mar 8 14:53:30 2022 +0100 CAMEL-17763: cleaned up unused exceptions in camel-google-secret-manager --- .../manager/integration/GoogleSecretManagerIT.java | 16 ++++++++-------- ...leSecretManagerPropertiesNoEnvSourceTestIT.java | 20 ++++++++++---------- .../GoogleSecretManagerPropertiesSourceTestIT.java | 22 +++++++++++----------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerIT.java b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerIT.java index 56e5276..085cb5d 100644 --- a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerIT.java +++ b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerIT.java @@ -49,10 +49,10 @@ public class GoogleSecretManagerIT extends CamelTestSupport { private MockEndpoint listSecrets; @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:createSecret") .to("google-secret-manager://" + project + "?serviceAccountKey=" @@ -76,7 +76,7 @@ public class GoogleSecretManagerIT extends CamelTestSupport { } @Test - public void sendIn() throws Exception { + public void sendIn() { mockSecret.expectedMessageCount(1); mockGetSecret.expectedMessageCount(1); @@ -85,14 +85,14 @@ public class GoogleSecretManagerIT extends CamelTestSupport { template.send("direct:createSecret", new Processor() { @Override - public void process(Exchange exchange) throws Exception { + public void process(Exchange exchange) { exchange.getMessage().setHeader(GoogleSecretManagerConstants.SECRET_ID, "test123"); exchange.getMessage().setBody("Hello"); } }); Exchange ex = template.request("direct:getSecretVersion", new Processor() { @Override - public void process(Exchange exchange) throws Exception { + public void process(Exchange exchange) { exchange.getMessage().setHeader(GoogleSecretManagerConstants.SECRET_ID, "test123"); exchange.getMessage().setHeader(GoogleSecretManagerConstants.VERSION_ID, "1"); } @@ -102,7 +102,7 @@ public class GoogleSecretManagerIT extends CamelTestSupport { ex = template.request("direct:getSecretVersion", new Processor() { @Override - public void process(Exchange exchange) throws Exception { + public void process(Exchange exchange) { exchange.getMessage().setHeader(GoogleSecretManagerConstants.SECRET_ID, "test123"); } }); @@ -111,7 +111,7 @@ public class GoogleSecretManagerIT extends CamelTestSupport { ex = template.request("direct:listSecrets", new Processor() { @Override - public void process(Exchange exchange) throws Exception { + public void process(Exchange exchange) { } }); @@ -128,7 +128,7 @@ public class GoogleSecretManagerIT extends CamelTestSupport { assertEquals(1, totalSecret.get()); ex = template.request("direct:deleteSecret", new Processor() { @Override - public void process(Exchange exchange) throws Exception { + public void process(Exchange exchange) { exchange.getMessage().setHeader(GoogleSecretManagerConstants.SECRET_ID, "test123"); } }); diff --git a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesNoEnvSourceTestIT.java b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesNoEnvSourceTestIT.java index 31662ef..95cb291 100644 --- a/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesNoEnvSourceTestIT.java +++ b/components/camel-google/camel-google-secret-manager/src/test/java/org/apache/camel/component/google/secret/manager/integration/GoogleSecretManagerPropertiesNoEnvSourceTestIT.java @@ -40,7 +40,7 @@ public class GoogleSecretManagerPropertiesNoEnvSourceTestIT extends CamelTestSup context.getVaultConfiguration().gcp().setProjectId(System.getProperty("camel.vault.gcp.projectId")); context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:start").setBody(simple("{{gcp:hello}}")).to("mock:bar"); } }); @@ -59,7 +59,7 @@ public class GoogleSecretManagerPropertiesNoEnvSourceTestIT extends CamelTestSup context.getVaultConfiguration().gcp().setProjectId(System.getProperty("camel.vault.gcp.projectId")); context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:database_sample/username}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:database_sample/password}}")).to("mock:bar"); } @@ -79,7 +79,7 @@ public class GoogleSecretManagerPropertiesNoEnvSourceTestIT extends CamelTestSup context.getVaultConfiguration().gcp().setProjectId(System.getProperty("camel.vault.gcp.projectId")); context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:database_sample/username:oscerd}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:database_sample/password:password}}")).to("mock:bar"); } @@ -94,13 +94,13 @@ public class GoogleSecretManagerPropertiesNoEnvSourceTestIT extends CamelTestSup } @Test - public void testSecretNotFoundFunction() throws Exception { + public void testSecretNotFoundFunction() { context.getVaultConfiguration().gcp().setServiceAccountKey(System.getProperty("camel.vault.gcp.serviceAccountKey")); context.getVaultConfiguration().gcp().setProjectId(System.getProperty("camel.vault.gcp.projectId")); Exception exception = assertThrows(FailedToCreateRouteException.class, () -> { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:start").setBody(simple("{{gcp:testExample}}")).to("mock:bar"); } }); @@ -120,7 +120,7 @@ public class GoogleSecretManagerPropertiesNoEnvSourceTestIT extends CamelTestSup context.getVaultConfiguration().gcp().setProjectId(System.getProperty("camel.vault.gcp.projectId")); context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:postgresql/additional1:admin}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:postgresql/additional2:secret}}")).to("mock:bar"); } @@ -140,7 +140,7 @@ public class GoogleSecretManagerPropertiesNoEnvSourceTestIT extends CamelTestSup context.getVaultConfiguration().gcp().setProjectId(System.getProperty("camel.vault.gcp.projectId")); context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:test-3/additional1:admin}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:test-3/additional2:secret}}")).to("mock:bar"); } @@ -155,13 +155,13 @@ public class GoogleSecretManagerPropertiesNoEnvSourceTestIT extends CamelTestSup } @Test - public void testComplexCustomPropertiesExceptionFunction() throws Exception { + public void testComplexCustomPropertiesExceptionFunction() { context.getVaultConfiguration().gcp().setServiceAccountKey(System.getProperty("camel.vault.gcp.serviceAccountKey")); context.getVaultConfiguration().gcp().setProjectId(System.getProperty("camel.vault.gcp.projectId")); Exception exception = assertThrows(FailedToCreateRouteException.class, () -> { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:test-3/additional1}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:test-3/additional2}}")).to("mock:bar"); } @@ -182,7 +182,7 @@ public class GoogleSecretManagerPropertiesNoEnvSourceTestIT extends CamelTestSup context.getVaultConfiguration().gcp().setProjectId(System.getProperty("camel.vault.gcp.projectId")); context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:test-3:admin}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:test-1:secret}}")).to("mock:bar"); } 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 036c450..391cf05 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 @@ -32,7 +32,7 @@ public class GoogleSecretManagerPropertiesSourceTestIT extends CamelTestSupport public void testFunction() throws Exception { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:start").setBody(simple("{{gcp:hello}}")).to("mock:bar"); } }); @@ -51,7 +51,7 @@ public class GoogleSecretManagerPropertiesSourceTestIT extends CamelTestSupport public void testComplexPropertiesFunction() throws Exception { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:database_sample/username}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:database_sample/password}}")).to("mock:bar"); } @@ -71,7 +71,7 @@ public class GoogleSecretManagerPropertiesSourceTestIT extends CamelTestSupport public void testComplexPropertiesWithDefaultFunction() throws Exception { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:database_sample/username:oscerd}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:database_sample/password:password}}")).to("mock:bar"); } @@ -88,11 +88,11 @@ 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 testSecretNotFoundFunction() throws Exception { + public void testSecretNotFoundFunction() { Exception exception = assertThrows(FailedToCreateRouteException.class, () -> { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:start").setBody(simple("{{gcp:testExample}}")).to("mock:bar"); } }); @@ -112,7 +112,7 @@ public class GoogleSecretManagerPropertiesSourceTestIT extends CamelTestSupport public void testComplexCustomPropertiesDefaultValueFunction() throws Exception { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:postgresql/additional1:admin}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:postgresql/additional2:secret}}")).to("mock:bar"); } @@ -132,7 +132,7 @@ public class GoogleSecretManagerPropertiesSourceTestIT extends CamelTestSupport public void testComplexCustomPropertiesDefaultValueExceptionFunction() throws Exception { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:test-3/additional1:admin}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:test-3/additional2:secret}}")).to("mock:bar"); } @@ -149,11 +149,11 @@ 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 testComplexCustomPropertiesExceptionFunction() throws Exception { + public void testComplexCustomPropertiesExceptionFunction() { Exception exception = assertThrows(FailedToCreateRouteException.class, () -> { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:test-3/additional1}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:test-3/additional2}}")).to("mock:bar"); } @@ -174,7 +174,7 @@ public class GoogleSecretManagerPropertiesSourceTestIT extends CamelTestSupport public void testComplexSimpleDefaultValueExceptionFunction() throws Exception { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:test-3:admin}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:test-1:secret}}")).to("mock:bar"); } @@ -195,7 +195,7 @@ public class GoogleSecretManagerPropertiesSourceTestIT extends CamelTestSupport public void testComplexPropertiesDefaultInstanceFunction() throws Exception { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:username").setBody(simple("{{gcp:test-3:admin}}")).to("mock:bar"); from("direct:password").setBody(simple("{{gcp:test-1:secret}}")).to("mock:bar"); }
