diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramChatBotTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramChatBotTest.java index 21aa621afda66..62497c810eb83 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramChatBotTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramChatBotTest.java @@ -40,7 +40,7 @@ public class TelegramChatBotTest extends TelegramTestSupport { @Test - public void testChatBotResult() throws Exception { + public void testChatBotResult() { List msgs = Awaitility.await().atMost(5, TimeUnit.SECONDS) .until(() -> getMockRoutes().getMock("sendMessage").getRecordedMessages(), @@ -77,12 +77,12 @@ public String chatBotProcess2(String message) { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .bean(TelegramChatBotTest.this, "chatBotProcess1") diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConfigurationTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConfigurationTest.java index eae78920e9207..ff2bf8163e96a 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConfigurationTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConfigurationTest.java @@ -29,7 +29,7 @@ public class TelegramConfigurationTest extends TelegramTestSupport { @Test - public void testChatBotResult() throws Exception { + public void testChatBotResult() { TelegramEndpoint endpoint = (TelegramEndpoint) context().getEndpoints().stream() .filter(e -> e instanceof TelegramEndpoint).findAny().get(); TelegramConfiguration config = endpoint.getConfiguration(); @@ -46,10 +46,10 @@ public void testChatBotResult() throws Exception { } @Override - protected RoutesBuilder createRouteBuilder() throws Exception { + protected RoutesBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:telegram") .to("telegram:bots/?authorizationToken=mock-token&chatId=12345&delay=2000&timeout=10&limit=60&proxyHost=127.0.0.1&proxyPort=1234&proxyType=SOCKS5"); diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerChannelPostTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerChannelPostTest.java index e9061dca9c2d1..efd7420cacf8e 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerChannelPostTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerChannelPostTest.java @@ -69,12 +69,12 @@ public void testReceptionOfMessageWithAMessage() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .to("mock:telegram"); } diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerEmptyResponseTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerEmptyResponseTest.java index 9fa2de6c973ca..19cb9cebb1ecd 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerEmptyResponseTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerEmptyResponseTest.java @@ -54,12 +54,12 @@ public void testBehaviourWithEmptyUpdates() { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token").to("mock:telegram"); } } }; diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerFallbackConversionTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerFallbackConversionTest.java index a3ae2a762176b..1e054c35823db 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerFallbackConversionTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerFallbackConversionTest.java @@ -43,7 +43,7 @@ public class TelegramConsumerFallbackConversionTest extends TelegramTestSupport protected ProducerTemplate template; @Test - public void testEverythingOk() throws Exception { + public void testEverythingOk() { template.sendBody(new BrandNewType("wrapped message")); @@ -60,12 +60,12 @@ public void testEverythingOk() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:message") .to("telegram:bots?authorizationToken=mock-token&chatId=1234"); } diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorDisabledConsumerTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorDisabledConsumerTest.java index b0c222a084206..dbe80ba6759a3 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorDisabledConsumerTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorDisabledConsumerTest.java @@ -56,7 +56,7 @@ protected CamelContext createCamelContext() throws Exception { } @Test - public void testReceptionOfTwoMessages() throws Exception { + public void testReceptionOfTwoMessages() { HealthCheckRegistry hcr = context.getExtension(HealthCheckRegistry.class); HealthCheckRepository repo = hcr.getRepository("routes").get(); @@ -79,12 +79,12 @@ public void testReceptionOfTwoMessages() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token").routeId("telegram") .convertBodyTo(String.class) .to("mock:telegram"); diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorTest.java index 25f586e2498ea..fb4ad5e0b318e 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckErrorTest.java @@ -52,7 +52,7 @@ protected CamelContext createCamelContext() throws Exception { } @Test - public void testReceptionOfTwoMessages() throws Exception { + public void testReceptionOfTwoMessages() { HealthCheckRegistry hcr = context.getExtension(HealthCheckRegistry.class); HealthCheckRepository repo = hcr.getRepository("consumers").get(); @@ -88,12 +88,12 @@ public void testReceptionOfTwoMessages() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token").routeId("telegram") .convertBodyTo(String.class) .to("mock:telegram"); diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckOkTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckOkTest.java index 526b8435b8342..381a59ecc0154 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckOkTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerHealthCheckOkTest.java @@ -64,12 +64,12 @@ public void testReceptionOfTwoMessages() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .convertBodyTo(String.class) .to("mock:telegram"); diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerIncomingInlineQueryTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerIncomingInlineQueryTest.java index 8562c7842148c..8c58a04f2fd20 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerIncomingInlineQueryTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerIncomingInlineQueryTest.java @@ -57,12 +57,12 @@ public void testReceptionOfMessageWithAnInlineQueryMessage() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .to("mock:telegram"); } diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMappingTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMappingTest.java index fc851e3ff2d54..d003da1498cd5 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMappingTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMappingTest.java @@ -107,12 +107,12 @@ public void testMessageResultMapping() { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token").to("mock:telegram"); } } }; diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaDocumentTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaDocumentTest.java index d77235b3007e9..49b7430b1565f 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaDocumentTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaDocumentTest.java @@ -62,12 +62,12 @@ public void testReceptionOfMessageWithADocument() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .to("mock:telegram"); } diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaGameTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaGameTest.java index 5724f48b19544..0e559c4978bc6 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaGameTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaGameTest.java @@ -67,12 +67,12 @@ public void testReceptionOfAMessageWithAGame() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .to("mock:telegram"); } diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaPhotoTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaPhotoTest.java index db8d9807d598f..8d1d1211749a0 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaPhotoTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaPhotoTest.java @@ -53,12 +53,12 @@ public void testReceptionOfTwoMessagesOneWithMedia() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .to("mock:telegram"); } diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaStickerTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaStickerTest.java index 392c55ea04932..329c10bd1644c 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaStickerTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaStickerTest.java @@ -69,12 +69,12 @@ public void testReceptionOfAMessageWithASticker() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .to("mock:telegram"); } diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaVideoTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaVideoTest.java index f1093cd6bd7d6..ee3a51a41aa30 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaVideoTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMediaVideoTest.java @@ -63,12 +63,12 @@ public void testReceptionOfAMessageWithAVideo() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .to("mock:telegram"); } diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMultipleTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMultipleTest.java index 4c9cb98113768..5231c4ca4c142 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMultipleTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerMultipleTest.java @@ -43,12 +43,12 @@ public void testReceptionOfThreeMessagesFromTwoUpdates() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .convertBodyTo(String.class) .to("mock:telegram"); diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerServiceErrorTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerServiceErrorTest.java index 618d34b3fc0c6..7970da56bb4a6 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerServiceErrorTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerServiceErrorTest.java @@ -43,12 +43,12 @@ public void testConsumerRecovery() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .convertBodyTo(String.class) .to("mock:telegram"); diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerSingleTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerSingleTest.java index 70ebf92c48b7b..f4fb1c8ffe34e 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerSingleTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramConsumerSingleTest.java @@ -43,12 +43,12 @@ public void testReceptionOfTwoMessages() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("telegram:bots?authorizationToken=mock-token") .convertBodyTo(String.class) .to("mock:telegram"); diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerChatIdResolutionTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerChatIdResolutionTest.java index cef60146955ed..850146066a188 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerChatIdResolutionTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerChatIdResolutionTest.java @@ -40,7 +40,7 @@ public class TelegramProducerChatIdResolutionTest extends TelegramTestSupport { private Endpoint endpoint; @Test - public void testRouteWithFixedChatId() throws Exception { + public void testRouteWithFixedChatId() { final MockProcessor mockProcessor = getMockRoutes().getMock("sendMessage"); mockProcessor.clearRecordedMessages(); @@ -53,7 +53,7 @@ public void testRouteWithFixedChatId() throws Exception { } @Test - public void testRouteWithOverridenChatId() throws Exception { + public void testRouteWithOverridenChatId() { final MockProcessor mockProcessor = getMockRoutes().getMock("sendMessage"); mockProcessor.clearRecordedMessages(); @@ -71,12 +71,12 @@ public void testRouteWithOverridenChatId() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:telegram") .to("telegram:bots?authorizationToken=mock-token&chatId=my-id"); } diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerLocationTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerLocationTest.java index 70488a411d842..0e7ce3a558483 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerLocationTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerLocationTest.java @@ -84,7 +84,7 @@ public void testStopMessageLiveLocation() { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerMediaTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerMediaTest.java index 808b0b5bea6a9..9c56df153d4a8 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerMediaTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramProducerMediaTest.java @@ -262,7 +262,7 @@ public void testRouteWithDocument() throws Exception { } @Test - public void testRouteWithText() throws Exception { + public void testRouteWithText() { final MockProcessor mockProcessor = getMockRoutes().getMock("sendMessage"); mockProcessor.clearRecordedMessages(); @@ -280,7 +280,7 @@ public void testRouteWithText() throws Exception { @Test @Disabled - public void testRouteWithTextAndCustomKeyBoard() throws Exception { + public void testRouteWithTextAndCustomKeyBoard() { final MockProcessor mockProcessor = getMockRoutes().getMock("sendMessage"); mockProcessor.clearRecordedMessages(); @@ -302,7 +302,7 @@ public void testRouteWithTextAndCustomKeyBoard() throws Exception { } @Test - public void testRouteWithTextHtml() throws Exception { + public void testRouteWithTextHtml() { final MockProcessor mockProcessor = getMockRoutes().getMock("sendMessage"); mockProcessor.clearRecordedMessages(); @@ -320,7 +320,7 @@ public void testRouteWithTextHtml() throws Exception { } @Test - public void testRouteWithTextMarkdown() throws Exception { + public void testRouteWithTextMarkdown() { final MockProcessor mockProcessor = getMockRoutes().getMock("sendMessage"); mockProcessor.clearRecordedMessages(); @@ -338,7 +338,7 @@ public void testRouteWithTextMarkdown() throws Exception { } @Test - public void testRouteWithGame() throws Exception { + public void testRouteWithGame() { final MockProcessor mockProcessor = getMockRoutes().getMock("sendGame"); mockProcessor.clearRecordedMessages(); @@ -357,12 +357,12 @@ public void testRouteWithGame() throws Exception { } @Override - protected RoutesBuilder[] createRouteBuilders() throws Exception { + protected RoutesBuilder[] createRouteBuilders() { return new RoutesBuilder[] { getMockRoutes(), new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:telegram").to("telegram:bots?authorizationToken=mock-token&chatId=my-id"); } } }; diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookCallTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookCallTest.java index e4e99195bd1bf..da43e27473762 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookCallTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookCallTest.java @@ -52,15 +52,15 @@ public void testWebhookCall() throws Exception { } @Override - protected void doPreSetup() throws Exception { + protected void doPreSetup() { port = AvailablePortFinder.getNextAvailable(); } @Override - protected RoutesBuilder createRouteBuilder() throws Exception { + protected RoutesBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration() .host("localhost") .port(port); diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookRegistrationTest.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookRegistrationTest.java index 9d6d98e5c6cef..f5223ea319334 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookRegistrationTest.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/TelegramWebhookRegistrationTest.java @@ -62,7 +62,7 @@ public void testAutomaticRegistration() throws Exception { context().addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:telegram").to("telegram:bots?authorizationToken=mock-token"); from("webhook:telegram:bots?authorizationToken=mock-token").to("mock:endpoint"); } @@ -104,7 +104,7 @@ public void testNoRegistration() throws Exception { context().addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("webhook:telegram:bots?authorizationToken=mock-token&webhookAutoRegister=false").to("mock:endpoint"); } }); diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramMockRoutes.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramMockRoutes.java index 817858a88f60b..66645cf688c58 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramMockRoutes.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramMockRoutes.java @@ -53,7 +53,7 @@ public TelegramMockRoutes addErrorEndpoint(String path, String method, int error } @Override - public void configure() throws Exception { + public void configure() { mocks.forEach((key, value) -> { from("netty-http:http://localhost:" + port + "/botmock-token/" + key + "?httpMethodRestrict=" + value.method) diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramTestSupport.java b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramTestSupport.java index aa724de9338b7..7a4c4dd588de8 100644 --- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramTestSupport.java +++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramTestSupport.java @@ -41,7 +41,7 @@ public class TelegramTestSupport extends CamelTestSupport { private TelegramMockRoutes mockRoutes; @BeforeAll - public static void initPort() throws Exception { + public static void initPort() { port = AvailablePortFinder.getNextAvailable(); } diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerAsyncTest.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerAsyncTest.java index f04b5819ec0be..bdd49e6a32d82 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerAsyncTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerAsyncTest.java @@ -72,7 +72,7 @@ public void startThriftClient() throws IOException, TTransportException { } @AfterEach - public void stopThriftClient() throws Exception { + public void stopThriftClient() { if (transport != null) { transport.close(); transport = null; @@ -237,7 +237,7 @@ public void onError(Exception exception) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerConcurrentTest.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerConcurrentTest.java index dc53fd59110d7..dd5b3f990f165 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerConcurrentTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerConcurrentTest.java @@ -67,7 +67,7 @@ public static Integer getId() { } @Test - public void testSyncWithConcurrentThreads() throws Exception { + public void testSyncWithConcurrentThreads() { RunnableAssert ra = new RunnableAssert("testSyncWithConcurrentThreads") { @Override @@ -98,7 +98,7 @@ public void run() throws TTransportException { } @Test - public void testAsyncWithConcurrentThreads() throws Exception { + public void testAsyncWithConcurrentThreads() { RunnableAssert ra = new RunnableAssert("testAsyncWithConcurrentThreads") { @Override @@ -157,7 +157,7 @@ public Integer getCalculateResponse() { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerSecurityTest.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerSecurityTest.java index 74a1ff8f7435c..e370cc47ebdfe 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerSecurityTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerSecurityTest.java @@ -16,8 +16,6 @@ */ package org.apache.camel.component.thrift; -import java.io.IOException; - import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.component.thrift.generated.Calculator; @@ -61,7 +59,7 @@ public class ThriftConsumerSecurityTest extends CamelTestSupport { private TTransport transport; @BeforeEach - public void startThriftSecureClient() throws IOException, TTransportException { + public void startThriftSecureClient() throws TTransportException { if (transport == null) { LOG.info("Connecting to the secured Thrift server on port: {}", THRIFT_TEST_PORT); @@ -77,7 +75,7 @@ public void startThriftSecureClient() throws IOException, TTransportException { } @AfterEach - public void stopThriftClient() throws Exception { + public void stopThriftClient() { if (transport != null) { transport.close(); transport = null; @@ -86,7 +84,7 @@ public void stopThriftClient() throws Exception { } @Override - protected Registry createCamelRegistry() throws Exception { + protected Registry createCamelRegistry() { Registry reg = new SimpleRegistry(); SSLContextParameters sslParameters = new SSLContextParameters(); @@ -137,7 +135,7 @@ public void testEchoMethodInvocation() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerSyncTest.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerSyncTest.java index c95bfb64ce13a..0c6c0dc34df5f 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerSyncTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerSyncTest.java @@ -16,8 +16,6 @@ */ package org.apache.camel.component.thrift; -import java.io.IOException; - import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.component.thrift.generated.Calculator; @@ -52,7 +50,7 @@ public class ThriftConsumerSyncTest extends CamelTestSupport { private TTransport transport; @BeforeEach - public void startThriftClient() throws IOException, TTransportException { + public void startThriftClient() throws TTransportException { if (transport == null) { LOG.info("Connecting to the Thrift server on port: {}", THRIFT_TEST_PORT); transport = new TSocket("localhost", THRIFT_TEST_PORT); @@ -63,7 +61,7 @@ public void startThriftClient() throws IOException, TTransportException { } @AfterEach - public void stopThriftClient() throws Exception { + public void stopThriftClient() { if (transport != null) { transport.close(); transport = null; @@ -101,7 +99,7 @@ public void testEchoMethodInvocation() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerZlibCompressionTest.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerZlibCompressionTest.java index 00b2365f01074..71fd8c2bf9f54 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerZlibCompressionTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftConsumerZlibCompressionTest.java @@ -16,8 +16,6 @@ */ package org.apache.camel.component.thrift; -import java.io.IOException; - import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.component.thrift.generated.Calculator; @@ -55,7 +53,7 @@ public class ThriftConsumerZlibCompressionTest extends CamelTestSupport { private TTransport transport; @BeforeEach - public void startThriftZlibClient() throws IOException, TTransportException { + public void startThriftZlibClient() throws TTransportException { if (transport == null) { LOG.info("Connecting to the Thrift server with zlib compression on port: {}", THRIFT_TEST_PORT); @@ -68,7 +66,7 @@ public void startThriftZlibClient() throws IOException, TTransportException { } @AfterEach - public void stopThriftClient() throws Exception { + public void stopThriftClient() { if (transport != null) { transport.close(); transport = null; @@ -110,7 +108,7 @@ public void testEchoMethodInvocation() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerAsyncTest.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerAsyncTest.java index 9eb7427bc2884..9420afa103348 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerAsyncTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerAsyncTest.java @@ -270,7 +270,7 @@ public void onFailure(Exchange exchange) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerBaseTest.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerBaseTest.java index eb50500404717..2a5cd363b70bf 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerBaseTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerBaseTest.java @@ -16,8 +16,6 @@ */ package org.apache.camel.component.thrift; -import java.io.IOException; - import org.apache.camel.component.thrift.generated.Calculator; import org.apache.camel.component.thrift.impl.CalculatorSyncServerImpl; import org.apache.camel.test.AvailablePortFinder; @@ -58,7 +56,7 @@ public void run() { } @AfterAll - public static void stopThriftServer() throws IOException { + public static void stopThriftServer() { if (server != null) { server.stop(); serverTransport.close(); diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerSecurityTest.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerSecurityTest.java index 050d77f79f4ff..19892fe264ca8 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerSecurityTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerSecurityTest.java @@ -16,7 +16,6 @@ */ package org.apache.camel.component.thrift; -import java.io.IOException; import java.net.InetAddress; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -95,7 +94,7 @@ public void run() { } @AfterAll - public static void stopThriftServer() throws IOException { + public static void stopThriftServer() { if (server != null) { server.stop(); serverTransport.close(); @@ -104,7 +103,7 @@ public static void stopThriftServer() throws IOException { } @Override - protected Registry createCamelRegistry() throws Exception { + protected Registry createCamelRegistry() { Registry reg = new SimpleRegistry(); SSLContextParameters sslParameters = new SSLContextParameters(); @@ -123,7 +122,7 @@ protected Registry createCamelRegistry() throws Exception { @Test @SuppressWarnings({ "rawtypes", "unchecked" }) - public void testCalculateMethodInvocation() throws Exception { + public void testCalculateMethodInvocation() { LOG.info("Thrift calculate method sync test start"); List requestBody = new ArrayList(); @@ -140,7 +139,7 @@ public void testCalculateMethodInvocation() throws Exception { @Test @SuppressWarnings({ "rawtypes", "unchecked" }) - public void testCalculateWithException() throws Exception { + public void testCalculateWithException() { LOG.info("Thrift calculate method with business exception sync test start"); List requestBody = new ArrayList(); @@ -158,7 +157,7 @@ public void testCalculateWithException() throws Exception { } @Test - public void testVoidMethodInvocation() throws Exception { + public void testVoidMethodInvocation() { LOG.info("Thrift method with empty parameters and void output sync test start"); Object requestBody = null; @@ -167,7 +166,7 @@ public void testVoidMethodInvocation() throws Exception { } @Test - public void testOneWayMethodInvocation() throws Exception { + public void testOneWayMethodInvocation() { LOG.info("Thrift one-way method sync test start"); Object requestBody = null; @@ -177,7 +176,7 @@ public void testOneWayMethodInvocation() throws Exception { @Test @SuppressWarnings({ "rawtypes", "unchecked" }) - public void testAllTypesMethodInvocation() throws Exception { + public void testAllTypesMethodInvocation() { LOG.info("Thrift method with all possile types sync test start"); List requestBody = new ArrayList(); @@ -203,7 +202,7 @@ public void testAllTypesMethodInvocation() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerSyncTest.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerSyncTest.java index fca816ec96975..de826db560173 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerSyncTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerSyncTest.java @@ -42,7 +42,7 @@ public class ThriftProducerSyncTest extends ThriftProducerBaseTest { @Test @SuppressWarnings({ "rawtypes", "unchecked" }) - public void testCalculateMethodInvocation() throws Exception { + public void testCalculateMethodInvocation() { LOG.info("Thrift calculate method sync test start"); List requestBody = new ArrayList(); @@ -59,7 +59,7 @@ public void testCalculateMethodInvocation() throws Exception { @Test @SuppressWarnings({ "rawtypes", "unchecked" }) - public void testAddMethodInvocation() throws Exception { + public void testAddMethodInvocation() { LOG.info("Thrift add method (primitive parameters only) sync test start"); List requestBody = new ArrayList(); @@ -76,7 +76,7 @@ public void testAddMethodInvocation() throws Exception { @Test @SuppressWarnings({ "rawtypes", "unchecked" }) - public void testCalculateWithException() throws Exception { + public void testCalculateWithException() { LOG.info("Thrift calculate method with business exception sync test start"); List requestBody = new ArrayList(); @@ -94,7 +94,7 @@ public void testCalculateWithException() throws Exception { } @Test - public void testVoidMethodInvocation() throws Exception { + public void testVoidMethodInvocation() { LOG.info("Thrift method with empty parameters and void output sync test start"); Object requestBody = null; @@ -103,7 +103,7 @@ public void testVoidMethodInvocation() throws Exception { } @Test - public void testOneWayMethodInvocation() throws Exception { + public void testOneWayMethodInvocation() { LOG.info("Thrift one-way method sync test start"); Object requestBody = null; @@ -113,7 +113,7 @@ public void testOneWayMethodInvocation() throws Exception { @Test @SuppressWarnings({ "rawtypes", "unchecked" }) - public void testAllTypesMethodInvocation() throws Exception { + public void testAllTypesMethodInvocation() { LOG.info("Thrift method with all possile types sync test start"); List requestBody = new ArrayList(); @@ -140,7 +140,7 @@ public void testAllTypesMethodInvocation() throws Exception { @Test @SuppressWarnings({ "rawtypes", "unchecked" }) - public void testEchoMethodInvocation() throws Exception { + public void testEchoMethodInvocation() { LOG.info("Thrift echo method (return output as pass input parameter) sync test start"); List requestBody = new ArrayList(); @@ -156,7 +156,7 @@ public void testEchoMethodInvocation() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerZlibCompressionTest.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerZlibCompressionTest.java index bf5d65ed0b437..daab82ffff185 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerZlibCompressionTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/ThriftProducerZlibCompressionTest.java @@ -16,7 +16,6 @@ */ package org.apache.camel.component.thrift; -import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.util.ArrayList; @@ -81,7 +80,7 @@ public void run() { } @AfterAll - public static void stopThriftServer() throws IOException { + public static void stopThriftServer() { if (server != null) { server.stop(); serverTransport.close(); @@ -91,7 +90,7 @@ public static void stopThriftServer() throws IOException { @Test @SuppressWarnings({ "rawtypes", "unchecked" }) - public void testCalculateMethodInvocation() throws Exception { + public void testCalculateMethodInvocation() { LOG.info("Thrift calculate method sync test start"); List requestBody = new ArrayList(); @@ -107,7 +106,7 @@ public void testCalculateMethodInvocation() throws Exception { } @Test - public void testVoidMethodInvocation() throws Exception { + public void testVoidMethodInvocation() { LOG.info("Thrift method with empty parameters and void output sync test start"); Object requestBody = null; @@ -116,7 +115,7 @@ public void testVoidMethodInvocation() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Calculator.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Calculator.java index 0d2793830900a..5437b86465a79 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Calculator.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Calculator.java @@ -293,7 +293,7 @@ public static class ping_call extends org.apache.thrift.async.TAsyncMethodCall resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + org.apache.thrift.transport.TNonblockingTransport transport) { super(client, protocolFactory, transport, resultHandler, false); } @@ -331,7 +331,7 @@ public static class add_call extends org.apache.thrift.async.TAsyncMethodCall resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + org.apache.thrift.transport.TNonblockingTransport transport) { super(client, protocolFactory, transport, resultHandler, false); this.num1 = num1; this.num2 = num2; @@ -374,7 +374,7 @@ public calculate_call(int logid, Work w, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + org.apache.thrift.transport.TNonblockingTransport transport) { super(client, protocolFactory, transport, resultHandler, false); this.logid = logid; this.w = w; @@ -412,7 +412,7 @@ public static class zip_call extends org.apache.thrift.async.TAsyncMethodCall resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + org.apache.thrift.transport.TNonblockingTransport transport) { super(client, protocolFactory, transport, resultHandler, true); } @@ -449,7 +449,7 @@ public static class echo_call extends org.apache.thrift.async.TAsyncMethodCall resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + org.apache.thrift.transport.TNonblockingTransport transport) { super(client, protocolFactory, transport, resultHandler, false); this.w = w; } @@ -507,7 +507,7 @@ public alltypes_call(boolean v1, byte v2, short v3, int v4, long v5, double v6, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + org.apache.thrift.transport.TNonblockingTransport transport) { super(client, protocolFactory, transport, resultHandler, false); this.v1 = v1; this.v2 = v2; @@ -1282,7 +1282,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() throws org.apache.thrift.TException { + public void validate() { // check for required fields // check for sub-struct validity } @@ -1351,12 +1351,12 @@ public ping_argsTupleScheme getScheme() { private static class ping_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, ping_args struct) { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, ping_args struct) { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } } @@ -1536,7 +1536,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() throws org.apache.thrift.TException { + public void validate() { // check for required fields // check for sub-struct validity } @@ -1606,14 +1606,12 @@ public ping_resultTupleScheme getScheme() { private static class ping_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ping_result struct) - throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, ping_result struct) { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ping_result struct) - throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, ping_result struct) { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } } @@ -1957,7 +1955,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() throws org.apache.thrift.TException { + public void validate() { // check for required fields // check for sub-struct validity } @@ -2342,7 +2340,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() throws org.apache.thrift.TException { + public void validate() { // check for required fields // check for sub-struct validity } @@ -3279,7 +3277,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() throws org.apache.thrift.TException { + public void validate() { // check for required fields // check for sub-struct validity } @@ -3589,7 +3587,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() throws org.apache.thrift.TException { + public void validate() { // check for required fields // check for sub-struct validity } @@ -3657,12 +3655,12 @@ public zip_argsTupleScheme getScheme() { private static class zip_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, zip_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, zip_args struct) { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, zip_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, zip_args struct) { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } } @@ -6359,7 +6357,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() throws org.apache.thrift.TException { + public void validate() { // check for required fields // check for sub-struct validity } diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/InvalidOperation.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/InvalidOperation.java index 17f6b107c4704..0bc351cb6b83a 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/InvalidOperation.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/InvalidOperation.java @@ -366,7 +366,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() throws org.apache.thrift.TException { + public void validate() { // check for required fields // check for sub-struct validity } diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Work.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Work.java index def421b405475..1fa0353a71ff2 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Work.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Work.java @@ -549,7 +549,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() throws org.apache.thrift.TException { + public void validate() { // check for required fields // check for sub-struct validity } diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/impl/CalculatorAsyncServerImpl.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/impl/CalculatorAsyncServerImpl.java index 447014599525b..28c18741790a8 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/impl/CalculatorAsyncServerImpl.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/impl/CalculatorAsyncServerImpl.java @@ -24,7 +24,6 @@ import org.apache.camel.component.thrift.generated.Calculator; import org.apache.camel.component.thrift.generated.InvalidOperation; import org.apache.camel.component.thrift.generated.Work; -import org.apache.thrift.TException; import org.apache.thrift.async.AsyncMethodCallback; /** @@ -34,17 +33,17 @@ public class CalculatorAsyncServerImpl implements Calculator.AsyncIface { @Override @SuppressWarnings({ "rawtypes", "unchecked" }) - public void ping(AsyncMethodCallback resultHandler) throws TException { + public void ping(AsyncMethodCallback resultHandler) { resultHandler.onComplete(new Object()); } @Override - public void add(int num1, int num2, AsyncMethodCallback resultHandler) throws TException { + public void add(int num1, int num2, AsyncMethodCallback resultHandler) { resultHandler.onComplete(Integer.valueOf(num1 + num2)); } @Override - public void calculate(int logid, Work work, AsyncMethodCallback resultHandler) throws TException { + public void calculate(int logid, Work work, AsyncMethodCallback resultHandler) { int val = 0; switch (work.op) { case ADD: @@ -76,12 +75,12 @@ public void calculate(int logid, Work work, AsyncMethodCallback resultH @Override @SuppressWarnings({ "rawtypes", "unchecked" }) - public void zip(AsyncMethodCallback resultHandler) throws TException { + public void zip(AsyncMethodCallback resultHandler) { resultHandler.onComplete(new Object()); } @Override - public void echo(Work w, AsyncMethodCallback resultHandler) throws TException { + public void echo(Work w, AsyncMethodCallback resultHandler) { resultHandler.onComplete(w.deepCopy()); } @@ -89,8 +88,7 @@ public void echo(Work w, AsyncMethodCallback resultHandler) throws TExcept public void alltypes( boolean v1, byte v2, short v3, int v4, long v5, double v6, String v7, ByteBuffer v8, Work v9, List v10, Set v11, Map v12, - AsyncMethodCallback resultHandler) - throws TException { + AsyncMethodCallback resultHandler) { resultHandler.onComplete(Integer.valueOf(1)); } } diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/impl/CalculatorSyncServerImpl.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/impl/CalculatorSyncServerImpl.java index 560b6c07f0252..acf7ba82989fe 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/impl/CalculatorSyncServerImpl.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/impl/CalculatorSyncServerImpl.java @@ -32,11 +32,11 @@ public class CalculatorSyncServerImpl implements Calculator.Iface { @Override - public void ping() throws TException { + public void ping() { } @Override - public int add(int num1, int num2) throws TException { + public int add(int num1, int num2) { return num1 + num2; } @@ -73,19 +73,18 @@ public int calculate(int logId, Work work) throws InvalidOperation, TException { } @Override - public void zip() throws TException { + public void zip() { } @Override - public Work echo(Work w) throws TException { + public Work echo(Work w) { return w.deepCopy(); } @Override public int alltypes( boolean v1, byte v2, short v3, int v4, long v5, double v6, String v7, ByteBuffer v8, Work v9, List v10, - Set v11, Map v12) - throws TException { + Set v11, Map v12) { return 1; } } diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/local/ThriftThreadPoolServerTest.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/local/ThriftThreadPoolServerTest.java index 1b3a3357fcded..eaa1644a22a0d 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/local/ThriftThreadPoolServerTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/local/ThriftThreadPoolServerTest.java @@ -16,7 +16,6 @@ */ package org.apache.camel.component.thrift.local; -import java.io.IOException; import java.net.InetAddress; import org.apache.camel.component.thrift.ThriftProducerSecurityTest; @@ -85,7 +84,7 @@ public void startThriftServer() throws Exception { } @AfterEach - public void stopThriftServer() throws IOException { + public void stopThriftServer() { if (server != null) { server.stop(); serverTransport.close(); diff --git a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalJsonTest.java b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalJsonTest.java index 189d1995595e4..df3a605d476bf 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalJsonTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalJsonTest.java @@ -89,10 +89,10 @@ private void marshalAndUnmarshal(String inURI, String outURI) throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { ThriftDataFormat format = new ThriftDataFormat(new Work(), ThriftDataFormat.CONTENT_TYPE_FORMAT_JSON); from("direct:in").unmarshal(format).to("mock:reverse"); diff --git a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalSpringTest.java b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalSpringTest.java index 63a90f3584932..c8f7ddd0d2d7e 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalSpringTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalSpringTest.java @@ -57,11 +57,11 @@ public void testMarshalAndUnmarshalWithDSL2() throws Exception { } @Test - public void testMarshalAndUnmarshalWithDSL3() throws Exception { + public void testMarshalAndUnmarshalWithDSL3() { try { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:unmarshalC").unmarshal().thrift(new CamelException("wrong instance")).to("mock:reverse"); } }); diff --git a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalTest.java b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalTest.java index be30a6593b4a8..33da0d854b501 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalTest.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/ThriftMarshalAndUnmarshalTest.java @@ -51,11 +51,11 @@ public void testMarshalAndUnmarshalWithDSL2() throws Exception { } @Test - public void testMarshalAndUnmarshalWithDSL3() throws Exception { + public void testMarshalAndUnmarshalWithDSL3() { try { context.addRoutes(new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:unmarshalC").unmarshal().thrift(new CamelException("wrong instance")).to("mock:reverse"); } }); @@ -91,10 +91,10 @@ private void marshalAndUnmarshal(String inURI, String outURI) throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { ThriftDataFormat format = new ThriftDataFormat(new Work()); from("direct:in").marshal(format); diff --git a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java index 7c68f4ec9c1fe..4ab66e6100008 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java @@ -549,7 +549,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() throws org.apache.thrift.TException { + public void validate() { // check for required fields // check for sub-struct validity } diff --git a/components/camel-tika/src/test/java/org/apache/camel/component/tika/TikaDetectTest.java b/components/camel-tika/src/test/java/org/apache/camel/component/tika/TikaDetectTest.java index d01b6d6c9c6fe..dd9e90bc11b16 100644 --- a/components/camel-tika/src/test/java/org/apache/camel/component/tika/TikaDetectTest.java +++ b/components/camel-tika/src/test/java/org/apache/camel/component/tika/TikaDetectTest.java @@ -74,10 +74,10 @@ public boolean matches(Exchange exchange) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:start").to("tika:detect").to("mock:result"); } }; diff --git a/components/camel-tika/src/test/java/org/apache/camel/component/tika/TikaParseTest.java b/components/camel-tika/src/test/java/org/apache/camel/component/tika/TikaParseTest.java index e1772adb00406..0f752bfaa9ed3 100644 --- a/components/camel-tika/src/test/java/org/apache/camel/component/tika/TikaParseTest.java +++ b/components/camel-tika/src/test/java/org/apache/camel/component/tika/TikaParseTest.java @@ -178,10 +178,10 @@ public boolean matches(Exchange exchange) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:start").to("tika:parse").to("mock:result"); from("direct:start2").to("tika:parse?tikaConfigUri=src/test/resources/tika-empty.xml") .to("mock:result"); diff --git a/components/camel-twilio/src/test/java/org/apache/camel/component/twilio/AccountIT.java b/components/camel-twilio/src/test/java/org/apache/camel/component/twilio/AccountIT.java index d75fb0bf4cd2b..c0f9ba243844a 100644 --- a/components/camel-twilio/src/test/java/org/apache/camel/component/twilio/AccountIT.java +++ b/components/camel-twilio/src/test/java/org/apache/camel/component/twilio/AccountIT.java @@ -43,7 +43,7 @@ public class AccountIT extends AbstractTwilioTestSupport { private static final String PATH_PREFIX = TwilioApiCollection.getCollection().getApiName(AccountApiMethod.class).getName(); @Test - public void testFetcher() throws Exception { + public void testFetcher() { final Account result = requestBody("direct://FETCHER", null); assertNotNull(result, "fetcher result not null"); @@ -52,7 +52,7 @@ public void testFetcher() throws Exception { } @Test - public void testFetcherWithPathSid() throws Exception { + public void testFetcherWithPathSid() { final Account result = requestBodyAndHeaders("direct://FETCHER", null, headers("CamelTwilioPathSid", ((TwilioComponent) context().getComponent("twilio")).getAccountSid())); @@ -62,7 +62,7 @@ public void testFetcherWithPathSid() throws Exception { } @Test - public void testReader() throws Exception { + public void testReader() { final ResourceSet result = requestBody("direct://READER", null); assertNotNull(result, "reader result not null"); @@ -73,7 +73,7 @@ public void testReader() throws Exception { } @Test - public void testReaderWithStatusActive() throws Exception { + public void testReaderWithStatusActive() { final ResourceSet result = requestBodyAndHeaders("direct://READER", null, headers("CamelTwilioStatus", "active")); @@ -91,7 +91,7 @@ private static Map headers(String name, Object value) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { // test route for fetcher diff --git a/components/camel-twilio/src/test/java/org/apache/camel/component/twilio/TwilioEndpointTest.java b/components/camel-twilio/src/test/java/org/apache/camel/component/twilio/TwilioEndpointTest.java index 62f7f3e96fad3..0913b149b6db5 100644 --- a/components/camel-twilio/src/test/java/org/apache/camel/component/twilio/TwilioEndpointTest.java +++ b/components/camel-twilio/src/test/java/org/apache/camel/component/twilio/TwilioEndpointTest.java @@ -33,7 +33,7 @@ protected CamelContext createCamelContext() throws Exception { } @Test - public void testTwilioEndpoint() throws Exception { + public void testTwilioEndpoint() { // should not use reflection when creating and configuring endpoint ExtendedCamelContext ecc = context.adapt(ExtendedCamelContext.class); diff --git a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchByExchangeDirectIT.java b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchByExchangeDirectIT.java index 04013b868895e..0d0b211cdb711 100644 --- a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchByExchangeDirectIT.java +++ b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchByExchangeDirectIT.java @@ -89,7 +89,7 @@ public void testSearchTimelineWithDynamicQuerySinceId() throws Exception { } @Test - public void testSearchTimelineWithDynamicQuerySinceIdAndMaxId() throws Exception { + public void testSearchTimelineWithDynamicQuerySinceIdAndMaxId() { Map headers = new HashMap<>(); headers.put(TwitterConstants.TWITTER_KEYWORDS, "java"); headers.put(TwitterConstants.TWITTER_SINCEID, 258347905419730944L); diff --git a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java index 92ec0996ed894..ac44c97bfd5ae 100644 --- a/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java +++ b/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java @@ -33,7 +33,7 @@ public class UriConfigurationTest { private CamelTwitterITSupport support = new CamelTwitterITSupport(); @Test - public void testBasicAuthentication() throws Exception { + public void testBasicAuthentication() { Endpoint endpoint = context.getEndpoint("twitter-search:foo?" + support.getUriTokens()); assertTrue(endpoint instanceof TwitterSearchEndpoint, "Endpoint not a TwitterSearchEndpoint: " + endpoint); TwitterSearchEndpoint twitterEndpoint = (TwitterSearchEndpoint) endpoint; @@ -45,7 +45,7 @@ public void testBasicAuthentication() throws Exception { } @Test - public void testPageSetting() throws Exception { + public void testPageSetting() { Endpoint endpoint = context.getEndpoint("twitter-search:foo?count=50&numberOfPages=2&" + support.getUriTokens()); assertTrue(endpoint instanceof TwitterSearchEndpoint, "Endpoint not a TwitterSearchEndpoint: " + endpoint); TwitterSearchEndpoint twitterEndpoint = (TwitterSearchEndpoint) endpoint; @@ -55,7 +55,7 @@ public void testPageSetting() throws Exception { } @Test - public void testHttpProxySetting() throws Exception { + public void testHttpProxySetting() { Endpoint endpoint = context.getEndpoint( "twitter-search:foo?httpProxyHost=example.com&httpProxyPort=3338&httpProxyUser=test&httpProxyPassword=pwd&" + support.getUriTokens()); @@ -69,20 +69,20 @@ public void testHttpProxySetting() throws Exception { } @Test - public void testDirectMessageEndpoint() throws Exception { + public void testDirectMessageEndpoint() { Endpoint endpoint = context.getEndpoint("twitter-directmessage:foo?" + support.getUriTokens()); assertTrue(endpoint instanceof TwitterDirectMessageEndpoint, "Endpoint not a TwitterDirectMessageEndpoint: " + endpoint); } @Test - public void testSearchEndpoint() throws Exception { + public void testSearchEndpoint() { Endpoint endpoint = context.getEndpoint("twitter-search:foo?" + support.getUriTokens()); assertTrue(endpoint instanceof TwitterSearchEndpoint, "Endpoint not a TwitterSearchEndpoint: " + endpoint); } @Test - public void testTimelineEndpoint() throws Exception { + public void testTimelineEndpoint() { // set on component level instead AbstractTwitterComponent twitter = context.getComponent("twitter-timeline", AbstractTwitterComponent.class); twitter.setAccessToken(support.accessToken); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/BaseUndertowTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/BaseUndertowTest.java index 72066e0636517..3800440ba5740 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/BaseUndertowTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/BaseUndertowTest.java @@ -35,7 +35,7 @@ public abstract class BaseUndertowTest extends CamelTestSupport { private final AtomicInteger counter = new AtomicInteger(1); @BeforeAll - public static void initPort() throws Exception { + public static void initPort() { port = AvailablePortFinder.getNextAvailable(); port2 = AvailablePortFinder.getNextAvailable(); } @@ -56,7 +56,7 @@ protected CamelContext createCamelContext() throws Exception { } @BindToRegistry("prop") - public Properties loadProperties() throws Exception { + public Properties loadProperties() { Properties prop = new Properties(); prop.setProperty("port", "" + getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/DefaultUndertowHttpBindingTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/DefaultUndertowHttpBindingTest.java index 46ec4c3d8ebde..6898851bb9097 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/DefaultUndertowHttpBindingTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/DefaultUndertowHttpBindingTest.java @@ -96,7 +96,7 @@ private StreamSourceChannel source(final String[] delayedPayloads) { boolean mustWait; // make sure that the caller is not spinning on read==0 @Override - public int read(ByteBuffer dst) throws IOException { + public int read(ByteBuffer dst) { if (mustWait) { fail("must wait before reading"); } diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/MultiPartFormTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/MultiPartFormTest.java index 3a28199c4a438..186f7c1ee34ea 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/MultiPartFormTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/MultiPartFormTest.java @@ -37,7 +37,7 @@ public class MultiPartFormTest extends BaseUndertowTest { - private HttpEntity createMultipartRequestEntity() throws Exception { + private HttpEntity createMultipartRequestEntity() { File file = new File("src/test/resources/log4j2.properties"); return MultipartEntityBuilder.create() .addTextBody("comment", "A binary file of some kind") @@ -67,9 +67,9 @@ public void testSendMultiPartFormFromCamelHttpComponnent() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { - public void configure() throws Exception { + public void configure() { from("undertow://http://localhost:{{port}}/test").process(exchange -> { AttachmentMessage in = exchange.getIn(AttachmentMessage.class); assertEquals(1, in.getAttachments().size(), "Get a wrong attachement size"); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/PreservePostFormUrlEncodedBodyTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/PreservePostFormUrlEncodedBodyTest.java index 0b86c9085d418..c85e96d9f3f89 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/PreservePostFormUrlEncodedBodyTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/PreservePostFormUrlEncodedBodyTest.java @@ -29,7 +29,7 @@ public class PreservePostFormUrlEncodedBodyTest extends BaseUndertowTest { @Test - public void testSendToUndertow() throws Exception { + public void testSendToUndertow() { Exchange exchange = template.request("http://localhost:{{port}}/myapp/myservice?query1=a&query2=b", exchange1 -> { exchange1.getIn().setBody("b1=x&b2=y"); exchange1.getIn().setHeader("content-type", "application/x-www-form-urlencoded"); @@ -41,9 +41,9 @@ public void testSendToUndertow() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}/myapp/myservice?map").process(exchange -> { Map body = exchange.getIn().getBody(Map.class); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentTest.java index ebb59dc74ed89..c9aeb01fd661c 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentTest.java @@ -47,7 +47,7 @@ public void testUndertow() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { from("undertow:http://localhost:{{port}}/myapp") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentVerifierExtensionTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentVerifierExtensionTest.java index 02a101895fcef..843229f733840 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentVerifierExtensionTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentVerifierExtensionTest.java @@ -30,7 +30,7 @@ public class UndertowComponentVerifierExtensionTest extends BaseUndertowTest { @Test - public void testParameters() throws Exception { + public void testParameters() { Component component = context().getComponent("undertow"); ComponentVerifierExtension verifier = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new); @@ -45,7 +45,7 @@ public void testParameters() throws Exception { } @Test - public void testMissingParameters() throws Exception { + public void testMissingParameters() { Component component = context().getComponent("undertow"); ComponentVerifierExtension verifier = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new); @@ -64,7 +64,7 @@ public void testMissingParameters() throws Exception { } @Test - public void testConnectivity() throws Exception { + public void testConnectivity() { Component component = context().getComponent("undertow"); ComponentVerifierExtension verifier = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new); @@ -79,7 +79,7 @@ public void testConnectivity() throws Exception { } @Test - public void testConnectivityError() throws Exception { + public void testConnectivityError() { Component component = context().getComponent("undertow"); ComponentVerifierExtension verifier = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new); @@ -100,10 +100,10 @@ public void testConnectivityError() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}") .process(e -> e.getMessage().setBody("ok")); } diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentVerifierTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentVerifierTest.java index dbb8e31a8e2f8..b34d16e669516 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentVerifierTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentVerifierTest.java @@ -29,7 +29,7 @@ public class UndertowComponentVerifierTest extends BaseUndertowTest { @Test - public void testParameters() throws Exception { + public void testParameters() { UndertowComponent component = context().getComponent("undertow", UndertowComponent.class); ComponentVerifierExtension verifier = component.getVerifier(); @@ -43,7 +43,7 @@ public void testParameters() throws Exception { } @Test - public void testMissingParameters() throws Exception { + public void testMissingParameters() { UndertowComponent component = context.getComponent("undertow", UndertowComponent.class); ComponentVerifierExtension verifier = component.getVerifier(); @@ -61,7 +61,7 @@ public void testMissingParameters() throws Exception { } @Test - public void testConnectivity() throws Exception { + public void testConnectivity() { UndertowComponent component = context().getComponent("undertow", UndertowComponent.class); ComponentVerifierExtension verifier = component.getVerifier(); @@ -75,7 +75,7 @@ public void testConnectivity() throws Exception { } @Test - public void testConnectivityError() throws Exception { + public void testConnectivityError() { UndertowComponent component = context().getComponent("undertow", UndertowComponent.class); ComponentVerifierExtension verifier = component.getVerifier(); @@ -95,10 +95,10 @@ public void testConnectivityError() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}") .process(e -> e.getMessage().setBody("ok")); } diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowConsumerUnregisterTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowConsumerUnregisterTest.java index 7505413c92e52..d36f66353f582 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowConsumerUnregisterTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowConsumerUnregisterTest.java @@ -32,7 +32,7 @@ public class UndertowConsumerUnregisterTest extends BaseUndertowTest { @Test - public void testUnregisterUndertowConsumersForPort() throws Exception { + public void testUnregisterUndertowConsumersForPort() { UndertowComponent component = context.getComponent("undertow", UndertowComponent.class); UndertowConsumer consumerFoo = (UndertowConsumer) context.getRoute("route-foo").getConsumer(); UndertowConsumer consumerBar = (UndertowConsumer) context.getRoute("route-bar").getConsumer(); @@ -89,7 +89,7 @@ public void process(Exchange exchange) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { from("undertow:http://localhost:{{port}}/foo") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowEndpointTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowEndpointTest.java index 8da3b3a45afb6..817a13a9da7fc 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowEndpointTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowEndpointTest.java @@ -17,7 +17,6 @@ package org.apache.camel.component.undertow; import java.net.URI; -import java.net.URISyntaxException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -33,7 +32,7 @@ public class UndertowEndpointTest { final URI withoutSlash = URI.create("http://0.0.0.0:8080"); @BeforeEach - public void createEndpoint() throws URISyntaxException { + public void createEndpoint() { endpoint = new UndertowEndpoint(null, null); } diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowError500Test.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowError500Test.java index 8e97eca701334..347aea0d36be0 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowError500Test.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowError500Test.java @@ -40,10 +40,10 @@ public void testHttp500Error() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}/foo") .to("mock:input") // trigger failure by setting error code to 500 diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHandlersSpringTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHandlersSpringTest.java index eb29bb41aaa0a..da3ab518d5a9b 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHandlersSpringTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHandlersSpringTest.java @@ -55,7 +55,7 @@ public static void setUpJaas() throws Exception { } @AfterAll - public static void tearDownJaas() throws Exception { + public static void tearDownJaas() { System.clearProperty("java.security.auth.login.config"); } diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHeaderTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHeaderTest.java index 05533f0e6cd0a..db1fd6d06b951 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHeaderTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHeaderTest.java @@ -67,10 +67,10 @@ public void testHttpPathHeader() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}/headers") .to("mock:input") .transform().constant("Bye World"); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttp2Test.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttp2Test.java index 1577e38db2353..348644e1d432a 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttp2Test.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttp2Test.java @@ -67,7 +67,7 @@ protected CamelContext createCamelContext() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { from("undertow:http://localhost:{{port}}/myapp") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerSessionTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerSessionTest.java index 2017398167382..231f2aa4a3c96 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerSessionTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerSessionTest.java @@ -38,7 +38,7 @@ public class UndertowHttpProducerSessionTest extends CamelTestSupport { private ExchangeCookieHandler exchangeCookieHandler = new ExchangeCookieHandler(); @BeforeAll - public static void initPort() throws Exception { + public static void initPort() { port = AvailablePortFinder.getNextAvailable(); } @@ -76,10 +76,10 @@ private String getTestServerEndpointSessionUri() { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:start") .to("undertow:" + getTestServerEndpointSessionUrl()) .to("undertow:" + getTestServerEndpointSessionUrl()) @@ -98,7 +98,7 @@ public void configure() throws Exception { from(getTestServerEndpointSessionUri()) .process(new Processor() { @Override - public void process(Exchange exchange) throws Exception { + public void process(Exchange exchange) { Message message = exchange.getIn(); String body = message.getBody(String.class); // Undertow servers do not support sessions or diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerTest.java index bbe3dc80290db..71f2463afa880 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerTest.java @@ -59,10 +59,10 @@ public void testHttpSimpleHeaderAndBody() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}/foo") .to("mock:input") .transform().constant("Bye World"); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProxyPreserveHostTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProxyPreserveHostTest.java index 043e1cc4cae41..9a4957e115b72 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProxyPreserveHostTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProxyPreserveHostTest.java @@ -47,10 +47,10 @@ public void emptyPreseveHost() { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}") .toD("undertow:http://localhost:{{port2}}?bridgeEndpoint=true${body}"); from("undertow:http://localhost:{{port2}}") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpStreamCachingTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpStreamCachingTest.java index b31309ff96286..a554932c53e79 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpStreamCachingTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpStreamCachingTest.java @@ -28,17 +28,17 @@ public class UndertowHttpStreamCachingTest extends BaseUndertowTest { private String data = "abcdefg"; @Test - public void testTwoWayStreaming() throws Exception { + public void testTwoWayStreaming() { Exchange exchange = template.request("undertow:http://localhost:{{port}}/client", null); assertEquals(data, new String((byte[]) exchange.getMessage().getBody())); } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { getContext().setStreamCaching(true); getContext().getStreamCachingStrategy().setSpoolThreshold(3); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpStreamingTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpStreamingTest.java index 2275154487e19..1d463de0980b0 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpStreamingTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpStreamingTest.java @@ -107,10 +107,10 @@ private static void consumeStream(Exchange exchange) throws IOException { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}?useStreaming=true") .process(e -> consumeStream(e)) .to("mock:length") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpsSpringTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpsSpringTest.java index bf2fca48e394d..997ada9ad3871 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpsSpringTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpsSpringTest.java @@ -52,7 +52,7 @@ public static void setUpJaas() throws Exception { } @AfterAll - public static void tearDownJaas() throws Exception { + public static void tearDownJaas() { System.clearProperty("java.security.auth.login.config"); } diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowMethodRestricTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowMethodRestricTest.java index bbd754ed3bb09..b2aceae041d60 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowMethodRestricTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowMethodRestricTest.java @@ -69,10 +69,10 @@ public void testImproperHttpMethod() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow://http://localhost:{{port}}/methodRestrict?httpMethodRestrict=POST").process(exchange -> { Message in = exchange.getIn(); String request = in.getBody(String.class); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowNoAutoStartupTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowNoAutoStartupTest.java index 8dbc48759d713..f47eeaf544300 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowNoAutoStartupTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowNoAutoStartupTest.java @@ -21,11 +21,11 @@ public class UndertowNoAutoStartupTest extends BaseUndertowTest { @Test - public void testUndertow() throws Exception { + public void testUndertow() { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { from("undertow:http://localhost:{{port}}/myapp") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowPrefixMatchingTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowPrefixMatchingTest.java index de8831655e041..5d9bd49e71915 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowPrefixMatchingTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowPrefixMatchingTest.java @@ -29,13 +29,13 @@ public class UndertowPrefixMatchingTest extends BaseUndertowTest { @Test - public void passOnExactPath() throws Exception { + public void passOnExactPath() { template.requestBody("http://localhost:{{port}}/myapp/suffix", "Hello Camel!"); getMockEndpoint("mock:myapp").expectedHeaderReceived(Exchange.HTTP_RESPONSE_CODE, 200); } @Test - public void failsOnPrefixPath() throws Exception { + public void failsOnPrefixPath() { try { template.requestBody("http://localhost:{{port}}/myapp", "Hello Camel!"); fail("Should fail, something is wrong"); @@ -46,13 +46,13 @@ public void failsOnPrefixPath() throws Exception { } @Test - public void passOnPrefixPath() throws Exception { + public void passOnPrefixPath() { template.requestBody("http://localhost:{{port}}/bar/somethingNotImportant", "Hello Camel!"); getMockEndpoint("mock:myapp").expectedHeaderReceived(Exchange.HTTP_RESPONSE_CODE, 200); } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { from("undertow:http://localhost:{{port}}/myapp/suffix") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerContentTypeTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerContentTypeTest.java index 33eee293455ed..44a2d3806d08b 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerContentTypeTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerContentTypeTest.java @@ -38,10 +38,10 @@ public void testHttpContentTypeNotDuplicated() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration() .producerComponent("undertow").component("undertow") .host("localhost").port("{{port}}") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerLeakTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerLeakTest.java index 2023334cb0242..ae133c97fdcd6 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerLeakTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerLeakTest.java @@ -31,10 +31,10 @@ public void testLeak() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}/test").to("log:undertow?showAll=true").to("mock:result"); from("timer:foo?period=100").transform(constant("hello world")) diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java index 9c1a79a1646a2..2c422a90db05a 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java @@ -96,12 +96,12 @@ public void testHttpInputStream() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { private InputStream is = new ByteArrayInputStream("This is the InputStream".getBytes()); @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}/foo") .to("mock:input") .transform().constant("Bye World"); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerThrowExceptionOnFailureTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerThrowExceptionOnFailureTest.java index 7b441eed64728..9a7da175370ad 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerThrowExceptionOnFailureTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerThrowExceptionOnFailureTest.java @@ -33,7 +33,7 @@ public class UndertowProducerThrowExceptionOnFailureTest extends BaseUndertowTest { @Test - public void testFailWithoutException() throws Exception { + public void testFailWithoutException() { String out = template().requestBody("undertow:http://localhost:{{port}}/fail?throwExceptionOnFailure=false", null, String.class); assertEquals("Fail", out); @@ -67,10 +67,10 @@ public void testFailWithException2() { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration() .component("undertow").port(getPort2()) .bindingMode(RestBindingMode.json); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSendDynamicAwareTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSendDynamicAwareTest.java index ef49b82d044bc..602c1f17c2483 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSendDynamicAwareTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSendDynamicAwareTest.java @@ -26,7 +26,7 @@ public class UndertowSendDynamicAwareTest extends BaseUndertowTest { @Test - public void testDynamicAware() throws Exception { + public void testDynamicAware() { String out = fluentTemplate.to("direct:moes").withHeader("drink", "beer").request(String.class); assertEquals("Drinking beer", out); @@ -43,10 +43,10 @@ public void testDynamicAware() throws Exception { } @Override - protected RoutesBuilder createRouteBuilder() throws Exception { + protected RoutesBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:moes") .toD("undertow:http://localhost:{{port}}/moes?throwExceptionOnFailure=false&drink=${header.drink}"); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSharedPortTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSharedPortTest.java index 50cfa483f8efa..457afed4f49c0 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSharedPortTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSharedPortTest.java @@ -57,7 +57,7 @@ private void testPath(String pathSuffix) throws InterruptedException { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { from("undertow:http://localhost:{{port}}/first") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSuspendResumeTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSuspendResumeTest.java index d7131a74f1a07..09af0684cb7b9 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSuspendResumeTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSuspendResumeTest.java @@ -30,7 +30,7 @@ public class UndertowSuspendResumeTest extends BaseUndertowTest { private String serverUri = "http://localhost:{{port}}/foo"; @Test - public void testSuspendResume() throws Exception { + public void testSuspendResume() { context.getShutdownStrategy().setTimeout(50); String reply = template.requestBody(serverUri, "World", String.class); @@ -60,10 +60,10 @@ public void testSuspendResume() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow://" + serverUri).id("route1").transform(body().prepend("Bye ")); } }; diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSwitchingStatus204Test.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSwitchingStatus204Test.java index 6554f7e9bfec7..9d7617de4cf9e 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSwitchingStatus204Test.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSwitchingStatus204Test.java @@ -44,7 +44,7 @@ public void testSwitchNoBodyTo204ViaHttpEmptyBody() throws Exception { } @Test - public void testSwitchingNoBodyTo204NettyHttpViaCamelEmptyBody() throws Exception { + public void testSwitchingNoBodyTo204NettyHttpViaCamelEmptyBody() { Exchange inExchange = this.createExchangeWithBody("Hello World"); Exchange outExchange = template.send("undertow:http://localhost:{{port}}/foo", inExchange); @@ -54,7 +54,7 @@ public void testSwitchingNoBodyTo204NettyHttpViaCamelEmptyBody() throws Exceptio } @Test - public void testSwitchingNoBodyTo204ViaCamelRouteEmptyBody() throws Exception { + public void testSwitchingNoBodyTo204ViaCamelRouteEmptyBody() { Exchange inExchange = this.createExchangeWithBody("Hello World"); Exchange outExchange = template.send("direct:foo", inExchange); @@ -75,7 +75,7 @@ public void testNoSwitchingHasBodyViaHttpNoContent() throws Exception { } @Test - public void testNoSwitchingHasBodyNettyHttpViaCamelNoContent() throws Exception { + public void testNoSwitchingHasBodyNettyHttpViaCamelNoContent() { Exchange inExchange = this.createExchangeWithBody("Hello World"); Exchange outExchange = template.send("undertow:http://localhost:{{port}}/bar", inExchange); @@ -85,7 +85,7 @@ public void testNoSwitchingHasBodyNettyHttpViaCamelNoContent() throws Exception } @Test - public void testNoSwitchingHasBodyViaCamelRouteNoContent() throws Exception { + public void testNoSwitchingHasBodyViaCamelRouteNoContent() { Exchange inExchange = this.createExchangeWithBody("Hello World"); Exchange outExchange = template.send("direct:bar", inExchange); @@ -106,7 +106,7 @@ public void testNoSwitchingHasCodeViaHttpNoContent() throws Exception { } @Test - public void testNoSwitchingHasCodeNettyHttpViaCamelNoContent() throws Exception { + public void testNoSwitchingHasCodeNettyHttpViaCamelNoContent() { Exchange inExchange = this.createExchangeWithBody("Hello World"); Exchange outExchange = template.send("undertow:http://localhost:{{port}}/foobar", inExchange); @@ -116,7 +116,7 @@ public void testNoSwitchingHasCodeNettyHttpViaCamelNoContent() throws Exception } @Test - public void testNoSwitchingHasCodeViaCamelRouteNoContent() throws Exception { + public void testNoSwitchingHasCodeViaCamelRouteNoContent() { Exchange inExchange = this.createExchangeWithBody("Hello World"); Exchange outExchange = template.send("direct:foobar", inExchange); @@ -126,10 +126,10 @@ public void testNoSwitchingHasCodeViaCamelRouteNoContent() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}/foo") .setBody().constant(""); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/cloud/UndertowServiceCallRouteTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/cloud/UndertowServiceCallRouteTest.java index af2fb435d4ecf..ae96ccc62e45c 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/cloud/UndertowServiceCallRouteTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/cloud/UndertowServiceCallRouteTest.java @@ -44,7 +44,7 @@ protected CamelContext createCamelContext() throws Exception { } @Test - public void testCustomCall() throws Exception { + public void testCustomCall() { BeanIntrospection bi = context.adapt(ExtendedCamelContext.class).getBeanIntrospection(); assertEquals("8081", template.requestBody("direct:custom", "hello", String.class)); @@ -55,7 +55,7 @@ public void testCustomCall() throws Exception { } @Test - public void testDefaultSchema() throws Exception { + public void testDefaultSchema() { BeanIntrospection bi = context.adapt(ExtendedCamelContext.class).getBeanIntrospection(); try { @@ -69,10 +69,10 @@ public void testDefaultSchema() throws Exception { } @Override - protected RoutesBuilder createRouteBuilder() throws Exception { + protected RoutesBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("direct:custom") .serviceCall() .name("myService") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestApiUndertowTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestApiUndertowTest.java index d6705b3a9c9bb..b4fedb880208b 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestApiUndertowTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestApiUndertowTest.java @@ -34,7 +34,7 @@ protected boolean useJmx() { } @Test - public void testApi() throws Exception { + public void testApi() { String out = template.requestBody("undertow:http://localhost:{{port}}/api-doc", null, String.class); assertNotNull(out); assertTrue(out.contains("\"version\" : \"1.2.3\"")); @@ -45,10 +45,10 @@ public void testApi() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration().component("undertow").host("localhost").port(getPort()).apiContextPath("/api-doc") .apiProperty("cors", "true").apiProperty("api.title", "The hello rest thing") .apiProperty("api.version", "1.2.3"); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestGetTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestGetTest.java index cda2bb9ae93a7..701e2f5b1cb78 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestGetTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestGetTest.java @@ -25,13 +25,13 @@ public class RestGetTest extends BaseUndertowTest { @Test - public void testUndertowProducerGet() throws Exception { + public void testUndertowProducerGet() { String out = template.requestBody("undertow:http://localhost:{{port}}/users/123/basic", null, String.class); assertEquals("123;Donald Duck", out); } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestManagementTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestManagementTest.java index 8cfa2fc5224de..961eb441eaa88 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestManagementTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestManagementTest.java @@ -52,7 +52,7 @@ public void testRestManagement() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowComponentVerifierTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowComponentVerifierTest.java index 6b1cfe21a77ac..8651fb9f39ecd 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowComponentVerifierTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowComponentVerifierTest.java @@ -30,7 +30,7 @@ public class RestUndertowComponentVerifierTest extends BaseUndertowTest { @Test - public void testParameters() throws Exception { + public void testParameters() { RestComponent component = context().getComponent("rest", RestComponent.class); ComponentVerifierExtension verifier = component.getVerifier(); @@ -46,7 +46,7 @@ public void testParameters() throws Exception { } @Test - public void testMissingRestParameters() throws Exception { + public void testMissingRestParameters() { RestComponent component = context.getComponent("rest", RestComponent.class); ComponentVerifierExtension verifier = component.getVerifier(); @@ -70,7 +70,7 @@ public void testMissingRestParameters() throws Exception { } @Test - public void testWrongComponentParameters() throws Exception { + public void testWrongComponentParameters() { RestComponent component = context.getComponent("rest", RestComponent.class); ComponentVerifierExtension verifier = component.getVerifier(); @@ -95,7 +95,7 @@ public void testWrongComponentParameters() throws Exception { } @Test - public void testConnectivity() throws Exception { + public void testConnectivity() { RestComponent component = context().getComponent("rest", RestComponent.class); ComponentVerifierExtension verifier = component.getVerifier(); @@ -111,10 +111,10 @@ public void testConnectivity() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration() .component("undertow") .host("localhost") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowContentTypeTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowContentTypeTest.java index 85ea4b957a052..d650223d9a2ee 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowContentTypeTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowContentTypeTest.java @@ -30,7 +30,7 @@ public class RestUndertowContentTypeTest extends BaseUndertowTest { @Test - public void testProducerNoContentType() throws Exception { + public void testProducerNoContentType() { String out = fluentTemplate.withHeader(Exchange.HTTP_METHOD, "post").withBody("{ \"name\": \"Donald Duck\" }") .to("http://localhost:" + getPort() + "/users/123/update") .request(String.class); @@ -39,7 +39,7 @@ public void testProducerNoContentType() throws Exception { } @Test - public void testProducerContentTypeValid() throws Exception { + public void testProducerContentTypeValid() { String out = fluentTemplate.withHeader(Exchange.CONTENT_TYPE, "application/json") .withHeader(Exchange.HTTP_METHOD, "post").withBody("{ \"name\": \"Donald Duck\" }") .to("http://localhost:" + getPort() + "/users/123/update").request(String.class); @@ -62,7 +62,7 @@ public void testProducerContentTypeInvalid() { } @Test - public void testProducerMultiContentTypeValid() throws Exception { + public void testProducerMultiContentTypeValid() { String out = fluentTemplate.withHeader("Accept", "application/csv") .withHeader(Exchange.HTTP_METHOD, "get") .to("http://localhost:" + getPort() + "/users").request(String.class); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeAutoWithJsonTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeAutoWithJsonTest.java index 13ddcdd812bae..111f9bc74813e 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeAutoWithJsonTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeAutoWithJsonTest.java @@ -45,10 +45,10 @@ public void testBindingMode() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration().component("undertow").host("localhost").port(getPort()).bindingMode(RestBindingMode.auto); // use the rest DSL to define the rest services diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeAutoWithXmlTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeAutoWithXmlTest.java index c0df305408c04..39ffb154e38d8 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeAutoWithXmlTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeAutoWithXmlTest.java @@ -45,10 +45,10 @@ public void testBindingMode() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration().component("undertow").host("localhost").port(getPort()).bindingMode(RestBindingMode.auto); // use the rest DSL to define the rest services diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeJsonTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeJsonTest.java index 934e644b9a2f6..0701e8efaf303 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeJsonTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeJsonTest.java @@ -60,10 +60,10 @@ public void testBindingModeWrong() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration().component("undertow").host("localhost").port(getPort()).bindingMode(RestBindingMode.json); // use the rest DSL to define the rest services diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeJsonWithContractTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeJsonWithContractTest.java index a3faaaac7238f..1d3b8293fec9c 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeJsonWithContractTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeJsonWithContractTest.java @@ -54,10 +54,10 @@ public void testBindingModeJsonWithContract() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { context.getTypeConverterRegistry().addTypeConverters(new MyTypeConverters()); restConfiguration().component("undertow").host("localhost").port(getPort()).bindingMode(RestBindingMode.json); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeOffWithContractTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeOffWithContractTest.java index 739037fe1578c..055a1b2fb5286 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeOffWithContractTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeOffWithContractTest.java @@ -56,10 +56,10 @@ public void testBindingModeOffWithContract() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration().component("undertow").host("localhost").port(getPort()).bindingMode(RestBindingMode.off); JsonDataFormat jsondf = new JsonDataFormat(); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeXmlTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeXmlTest.java index d916a7a923818..3a881a2eeb4c3 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeXmlTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpBindingModeXmlTest.java @@ -63,10 +63,10 @@ public void testBindingModeWrong() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration().component("undertow").host("localhost").port(getPort()).bindingMode(RestBindingMode.xml); // use the rest DSL to define the rest services diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpContextPathConfigurationTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpContextPathConfigurationTest.java index fdff1a88bdc1d..ae3d9dde47bf8 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpContextPathConfigurationTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpContextPathConfigurationTest.java @@ -25,7 +25,7 @@ public class RestUndertowHttpContextPathConfigurationTest extends BaseUndertowTest { @Test - public void testProducerGet() throws Exception { + public void testProducerGet() { String out = template.requestBody("undertow:http://localhost:{{port}}/rest/users/123", null, String.class); assertEquals("123;Donald Duck", out); @@ -34,10 +34,10 @@ public void testProducerGet() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").contextPath("/rest").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpContextPathMatchGetTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpContextPathMatchGetTest.java index 638927e060569..6adaf53ec339f 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpContextPathMatchGetTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpContextPathMatchGetTest.java @@ -25,7 +25,7 @@ public class RestUndertowHttpContextPathMatchGetTest extends BaseUndertowTest { @Test - public void testProducerGet() throws Exception { + public void testProducerGet() { String out = template.requestBody("undertow:http://localhost:{{port}}/users/123", null, String.class); assertEquals("123;Donald Duck", out); @@ -34,10 +34,10 @@ public void testProducerGet() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetCorsTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetCorsTest.java index 9b3a36a5bd32d..fcc814d111ca6 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetCorsTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetCorsTest.java @@ -89,10 +89,10 @@ public void testCorsPut() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()).enableCORS(true); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetOrderingIssueTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetOrderingIssueTest.java index fe953e1e8a919..48b026a0fb45c 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetOrderingIssueTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetOrderingIssueTest.java @@ -47,10 +47,10 @@ public void testProducerGet() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetTest.java index 90f398dce333e..9634590746877 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetTest.java @@ -25,16 +25,16 @@ public class RestUndertowHttpGetTest extends BaseUndertowTest { @Test - public void testProducerGet() throws Exception { + public void testProducerGet() { String out = template.requestBody("undertow:http://localhost:{{port}}/users/123/basic", null, String.class); assertEquals("123;Donald Duck", out); } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetWildcardsTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetWildcardsTest.java index 2937e3dd3b8c5..7df12c6490ad2 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetWildcardsTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpGetWildcardsTest.java @@ -31,22 +31,22 @@ public class RestUndertowHttpGetWildcardsTest extends BaseUndertowTest { private UndertowHttpBinding binding = new DefaultUndertowHttpBinding(); @Test - public void testProducerGet() throws Exception { + public void testProducerGet() { String out = template.requestBody("undertow:http://localhost:{{port}}/users/123/basic", null, String.class); assertEquals("123;Donald Duck", out); } @Test - public void testServletProducerGetWildcards() throws Exception { + public void testServletProducerGetWildcards() { String out = template.requestBody("undertow:http://localhost:{{port}}/users/456/name=g*", null, String.class); assertEquals("456;Goofy", out); } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpMultipleVerbsTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpMultipleVerbsTest.java index 05848c8701416..ebce7d785d6e0 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpMultipleVerbsTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpMultipleVerbsTest.java @@ -40,10 +40,10 @@ public void testProducerGetPut() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpOptionsTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpOptionsTest.java index e57d7c2e4530c..142b2c9546e68 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpOptionsTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpOptionsTest.java @@ -26,7 +26,7 @@ public class RestUndertowHttpOptionsTest extends BaseUndertowTest { @Test - public void testUndertowServerOptions() throws Exception { + public void testUndertowServerOptions() { Exchange exchange = template.request("undertow:http://localhost:" + getPort() + "/users/v1/customers", exchange1 -> exchange1.getIn().setHeader(Exchange.HTTP_METHOD, "OPTIONS")); @@ -51,10 +51,10 @@ public void testMultipleHttpOptions() { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPojoInOutTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPojoInOutTest.java index a85ffe57bf1ff..5ce4705618975 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPojoInOutTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPojoInOutTest.java @@ -27,7 +27,7 @@ public class RestUndertowHttpPojoInOutTest extends BaseUndertowTest { @Test - public void testUndertowPojoInOut() throws Exception { + public void testUndertowPojoInOut() { String body = "{\"id\": 123, \"name\": \"Donald Duck\"}"; String out = template.requestBody("undertow:http://localhost:{{port}}/users/lives", body, String.class); @@ -36,7 +36,7 @@ public void testUndertowPojoInOut() throws Exception { } @Test - public void testUndertowGetRequest() throws Exception { + public void testUndertowGetRequest() { String out = template.requestBody("undertow:http://localhost:{{port}}/users/lives", null, String.class); assertNotNull(out); @@ -44,10 +44,10 @@ public void testUndertowGetRequest() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port // and enable auto binding mode restConfiguration().component("undertow").host("localhost").port(getPort()).bindingMode(RestBindingMode.auto); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPojoTypeTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPojoTypeTest.java index 5ebf3266c547b..d8ffb7fbc04c2 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPojoTypeTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPojoTypeTest.java @@ -39,7 +39,7 @@ public class RestUndertowHttpPojoTypeTest extends BaseUndertowTest { private final ObjectMapper mapper = new ObjectMapper(); @Test - public void testUndertowPojoTypeValidateModel() throws Exception { + public void testUndertowPojoTypeValidateModel() { // Wasn't clear if there's a way to put this test into camel-core just to test the model // perhaps without starting the Camel Context? @@ -83,7 +83,7 @@ public void testUndertowPojoTypeGetUsers() throws Exception { } @Test - public void testUndertowPojoTypePutUser() throws Exception { + public void testUndertowPojoTypePutUser() { Exchange outExchange = template.request("undertow:http://localhost:{{port}}/users/1", exchange -> { exchange.getIn().setHeader(Exchange.HTTP_METHOD, "PUT"); exchange.getIn().setHeader(Exchange.ACCEPT_CONTENT_TYPE, "application/json"); @@ -248,10 +248,10 @@ public void testUndertowPojoTypePutUsersListFail() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { onException(Exception.class) .handled(true) .setHeader(Exchange.HTTP_RESPONSE_CODE, constant(400)) diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonJaxbPojoTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonJaxbPojoTest.java index ee67777c37755..7b294d946a86a 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonJaxbPojoTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonJaxbPojoTest.java @@ -45,10 +45,10 @@ public void testPostJaxbPojo() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port // and enable auto binding mode restConfiguration().component("undertow").host("localhost").port(getPort()).bindingMode(RestBindingMode.auto); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonNestedPojoListTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonNestedPojoListTest.java index a62cd273487c0..a9b15b6ace675 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonNestedPojoListTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonNestedPojoListTest.java @@ -52,10 +52,10 @@ public void testPostPojoList() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port // and enable auto binding mode restConfiguration() diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonPojoListTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonPojoListTest.java index 012fbc51f9bc4..d99a3f523c7b1 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonPojoListTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonPojoListTest.java @@ -52,10 +52,10 @@ public void testPostPojoList() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port // and enable auto binding mode restConfiguration().component("undertow").host("localhost").port(getPort()).bindingMode(RestBindingMode.auto); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonPojoTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonPojoTest.java index 4f789e911a3ca..4cc27e6f556b0 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonPojoTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostJsonPojoTest.java @@ -45,10 +45,10 @@ public void testPostPojo() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port // and enable auto binding mode restConfiguration().component("undertow").host("localhost").port(getPort()).bindingMode(RestBindingMode.auto); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostXmlJaxbPojoTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostXmlJaxbPojoTest.java index 5c6af87204ace..adbebf7f12469 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostXmlJaxbPojoTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowHttpPostXmlJaxbPojoTest.java @@ -63,10 +63,10 @@ public void testPostJaxbPojoNoContentType() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port // and enable auto binding mode restConfiguration().component("undertow").host("localhost").port(getPort()).bindingMode(RestBindingMode.auto); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowMethodNotAllowedTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowMethodNotAllowedTest.java index 75271b8add736..2ad8527c12fa8 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowMethodNotAllowedTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowMethodNotAllowedTest.java @@ -51,7 +51,7 @@ public void testGetMethodAllowed() { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerEncodingTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerEncodingTest.java index bf2bd0a818c04..9d0409952ad41 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerEncodingTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerEncodingTest.java @@ -25,22 +25,22 @@ public class RestUndertowProducerEncodingTest extends BaseUndertowTest { @Test - public void testSelect() throws Exception { + public void testSelect() { template.sendBody("rest:get:bw-web-api/v1/objects/timesheets?companyId=RD&select=personId,personName", "Hello World"); } @Test - public void testFilter() throws Exception { + public void testFilter() { template.sendBody("rest:get:bw-web-api/v1/objects/timesheets?companyId=RD&select=personId,personName" + "&filter=date(time/date) ge 2020-06-01 and personId eq 'R10019'", "Bye World"); } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetPojoTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetPojoTest.java index 86f90e3a2788b..6c841f3b28fb3 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetPojoTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetPojoTest.java @@ -31,7 +31,7 @@ public class RestUndertowProducerGetPojoTest extends BaseUndertowTest { @Test - public void testUndertowGetPojoRequest() throws Exception { + public void testUndertowGetPojoRequest() { // should not use reflection when using rest binding in the rest producer BeanIntrospection bi = context.adapt(ExtendedCamelContext.class).getBeanIntrospection(); bi.setLoggingLevel(LoggingLevel.INFO); @@ -51,10 +51,10 @@ public void testUndertowGetPojoRequest() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port // and enable auto binding mode restConfiguration() diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetTest.java index 89c265d325513..24906784a2e67 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetTest.java @@ -25,16 +25,16 @@ public class RestUndertowProducerGetTest extends BaseUndertowTest { @Test - public void testUndertowProducerGet() throws Exception { + public void testUndertowProducerGet() { String out = fluentTemplate.withHeader("id", "123").to("direct:start").request(String.class); assertEquals("123;Donald Duck", out); } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetUriParameterTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetUriParameterTest.java index 8aa1e51ff5cca..18dad9792d39e 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetUriParameterTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerGetUriParameterTest.java @@ -25,16 +25,16 @@ public class RestUndertowProducerGetUriParameterTest extends BaseUndertowTest { @Test - public void testUndertowProducerGet() throws Exception { + public void testUndertowProducerGet() { String out = fluentTemplate.withHeader("id", "123").to("direct:start").request(String.class); assertEquals("123;Donald Duck", out); } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerPatchTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerPatchTest.java index 02f4cdc1a3913..6fdd14196bfdf 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerPatchTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerPatchTest.java @@ -38,10 +38,10 @@ public void testUndertowProducerPatch() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerPutTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerPutTest.java index f26227c777fa3..7dab51b595f43 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerPutTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerPutTest.java @@ -32,10 +32,10 @@ public void testUndertowProducerPut() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerThrowExceptionErrorTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerThrowExceptionErrorTest.java index 7782b98eda805..f2e98c99c42f1 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerThrowExceptionErrorTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerThrowExceptionErrorTest.java @@ -28,13 +28,13 @@ public class RestUndertowProducerThrowExceptionErrorTest extends BaseUndertowTest { @Test - public void testUndertowProducerOk() throws Exception { + public void testUndertowProducerOk() { String out = fluentTemplate.withHeader("id", "123").to("direct:start").request(String.class); assertEquals("123;Donald Duck", out); } @Test - public void testUndertowProducerFail() throws Exception { + public void testUndertowProducerFail() { Exchange out = fluentTemplate.withHeader("id", "777").to("direct:start").request(Exchange.class); assertNotNull(out); assertFalse(out.isFailed(), "Should not have thrown exception"); @@ -42,10 +42,10 @@ public void testUndertowProducerFail() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()) .endpointProperty("throwExceptionOnFailure", "false"); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerVerbUpperCaseTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerVerbUpperCaseTest.java index 915ca38cadef3..ec39cd777cf9f 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerVerbUpperCaseTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowProducerVerbUpperCaseTest.java @@ -26,16 +26,16 @@ public class RestUndertowProducerVerbUpperCaseTest extends BaseUndertowTest { @Test - public void testVerbUpperCase() throws Exception { + public void testVerbUpperCase() { String out = fluentTemplate.withHeader("id", "123").to("direct:start").request(String.class); assertEquals("123;Donald Duck", out); } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { // configure to use undertow on localhost with the given port restConfiguration().component("undertow").host("localhost").port(getPort()); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowVerbEnableCorsTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowVerbEnableCorsTest.java index 8f24bbbe606e6..2cfaa91b5a0ea 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowVerbEnableCorsTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowVerbEnableCorsTest.java @@ -27,14 +27,14 @@ public class RestUndertowVerbEnableCorsTest extends BaseUndertowTest { @Test - public void testGetAll() throws Exception { + public void testGetAll() { String out = template.requestBodyAndHeader("http://localhost:" + getPort() + "/users", null, Exchange.HTTP_METHOD, "GET", String.class); assertEquals("[{ \"id\":\"1\", \"name\":\"Scott\" },{ \"id\":\"2\", \"name\":\"Claus\" }]", out); } @Test - public void testGetOne() throws Exception { + public void testGetOne() { String out = template.requestBodyAndHeader("http://localhost:" + getPort() + "/users/1", null, Exchange.HTTP_METHOD, "GET", String.class); assertEquals("{ \"id\":\"1\", \"name\":\"Scott\" }", out); @@ -78,10 +78,10 @@ public void testDelete() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration().component("undertow").host("localhost").port(getPort()).enableCORS(true); rest() diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowVerbTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowVerbTest.java index 6a92d62d48259..bbd4a5182d5b0 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowVerbTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/RestUndertowVerbTest.java @@ -27,14 +27,14 @@ public class RestUndertowVerbTest extends BaseUndertowTest { @Test - public void testGetAll() throws Exception { + public void testGetAll() { String out = template.requestBodyAndHeader("http://localhost:" + getPort() + "/users", null, Exchange.HTTP_METHOD, "GET", String.class); assertEquals("[{ \"id\":\"1\", \"name\":\"Scott\" },{ \"id\":\"2\", \"name\":\"Claus\" }]", out); } @Test - public void testGetOne() throws Exception { + public void testGetOne() { String out = template.requestBodyAndHeader("http://localhost:" + getPort() + "/users/1", null, Exchange.HTTP_METHOD, "GET", String.class); assertEquals("{ \"id\":\"1\", \"name\":\"Scott\" }", out); @@ -78,10 +78,10 @@ public void testDelete() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { restConfiguration().component("undertow").host("localhost").port(getPort()); rest() diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/UndertowHttpEmptyQueryParameterTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/UndertowHttpEmptyQueryParameterTest.java index ba0a412d48aac..8b99daed4d34b 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/UndertowHttpEmptyQueryParameterTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/rest/UndertowHttpEmptyQueryParameterTest.java @@ -40,10 +40,10 @@ public void testEmpty() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://0.0.0.0:{{port}}/foo") .to("mock:input") .transform().simple("Header: ${header.id}"); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/AbstractProviderServletTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/AbstractProviderServletTest.java index 4fc729ea0b1d5..58a5655e35e4f 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/AbstractProviderServletTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/AbstractProviderServletTest.java @@ -43,13 +43,13 @@ public abstract class AbstractProviderServletTest extends BaseUndertowTest { public abstract static class MockSecurityProvider implements UndertowSecurityProvider { @Override - public void addHeader(BiConsumer consumer, HttpServerExchange httpExchange) throws Exception { + public void addHeader(BiConsumer consumer, HttpServerExchange httpExchange) { String principalName = httpExchange.getAttachment(PRINCIPAL_NAME_KEY); consumer.accept(AbstractSecurityProviderTest.PRINCIPAL_PARAMETER, principalName); } @Override - public int authenticate(HttpServerExchange httpExchange, List allowedRoles) throws Exception { + public int authenticate(HttpServerExchange httpExchange, List allowedRoles) { ServletRequestContext servletRequestContext = httpExchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY); assertServletContext(servletRequestContext); @@ -92,10 +92,10 @@ protected CamelContext createCamelContext() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}/foo?allowedRoles=user") .to("mock:input") .transform(simple("${in.header." + AbstractSecurityProviderTest.PRINCIPAL_PARAMETER + "}")); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/AbstractSecurityProviderTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/AbstractSecurityProviderTest.java index 6efd8b78b3cfb..baf45941e0f70 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/AbstractSecurityProviderTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/AbstractSecurityProviderTest.java @@ -50,7 +50,7 @@ public static final class MockSecurityProvider implements UndertowSecurityProvid private MockSecurityConfiguration configuration; @Override - public void addHeader(BiConsumer consumer, HttpServerExchange httpExchange) throws Exception { + public void addHeader(BiConsumer consumer, HttpServerExchange httpExchange) { String principal = httpExchange.getAttachment(PRINCIPAL_KEY); if (principal != null) { consumer.accept(PRINCIPAL_PARAMETER, principal); @@ -58,7 +58,7 @@ public void addHeader(BiConsumer consumer, HttpServerExchange ht } @Override - public int authenticate(HttpServerExchange httpExchange, List allowedRoles) throws Exception { + public int authenticate(HttpServerExchange httpExchange, List allowedRoles) { if (configuration.getRoleToAssign() != null && allowedRoles != null && allowedRoles.contains(configuration.getRoleToAssign())) { httpExchange.putAttachment(PRINCIPAL_KEY, configuration.getRoleToAssign()); @@ -68,7 +68,7 @@ public int authenticate(HttpServerExchange httpExchange, List allowedRol } @Override - public boolean acceptConfiguration(Object configuration, String endpointUri) throws Exception { + public boolean acceptConfiguration(Object configuration, String endpointUri) { if (configuration instanceof MockSecurityConfiguration) { this.configuration = (MockSecurityConfiguration) configuration; return this.configuration.isAccept(); @@ -77,7 +77,7 @@ public boolean acceptConfiguration(Object configuration, String endpointUri) thr } @Override - public HttpHandler wrapHttpHandler(HttpHandler httpHandler) throws Exception { + public HttpHandler wrapHttpHandler(HttpHandler httpHandler) { if (configuration.getWrapHttpHandler() != null) { return configuration.getWrapHttpHandler().apply(httpHandler); } @@ -142,10 +142,10 @@ public static void createSecurtyProviderConfigurationFile() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}/foo?allowedRoles=user") .to("mock:input") .transform(simple("${in.header." + PRINCIPAL_PARAMETER + "}")); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderHttpHandlerTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderHttpHandlerTest.java index f597ce4b215f9..ae96a6ab4f929 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderHttpHandlerTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderHttpHandlerTest.java @@ -39,7 +39,7 @@ protected CamelContext createCamelContext() throws Exception { } @Test - public void testNullHttpHandler() throws Exception { + public void testNullHttpHandler() { securityConfiguration.setRoleToAssign("user"); try { diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderNoAcceptanceTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderNoAcceptanceTest.java index fce03d8a1ed83..c81eb154bd116 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderNoAcceptanceTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderNoAcceptanceTest.java @@ -40,7 +40,7 @@ protected CamelContext createCamelContext() throws Exception { } @Test - public void testSecuredNotAcceptingProvider() throws Exception { + public void testSecuredNotAcceptingProvider() { securityConfiguration.setRoleToAssign("user"); getMockEndpoint("mock:input").expectedHeaderReceived(Exchange.HTTP_METHOD, "GET"); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderRolesFromComponentTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderRolesFromComponentTest.java index 90242ee63eb8e..d10c363125d0d 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderRolesFromComponentTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderRolesFromComponentTest.java @@ -56,7 +56,7 @@ public void testSecuredAllowed() throws Exception { } @Test - public void testSecuredNotAllowed() throws Exception { + public void testSecuredNotAllowed() { securityConfiguration.setRoleToAssign("admin"); getMockEndpoint("mock:input").expectedHeaderReceived(Exchange.HTTP_METHOD, "GET"); @@ -73,10 +73,10 @@ public void testSecuredNotAllowed() throws Exception { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override - public void configure() throws Exception { + public void configure() { from("undertow:http://localhost:{{port}}/foo") .to("mock:input") .transform(simple("${in.header." + PRINCIPAL_PARAMETER + "}")); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderTest.java index ccc97c045a795..11b65cb579065 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderTest.java @@ -45,7 +45,7 @@ public void testSecuredAllowed() throws Exception { } @Test - public void testSecuredNotAllowed() throws Exception { + public void testSecuredNotAllowed() { securityConfiguration.setRoleToAssign("admin"); getMockEndpoint("mock:input").expectedHeaderReceived(Exchange.HTTP_METHOD, "GET"); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderWithoutProviderTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderWithoutProviderTest.java index 50222e43037a9..a986c8169b1eb 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderWithoutProviderTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/spi/SecurityProviderWithoutProviderTest.java @@ -36,7 +36,7 @@ public class SecurityProviderWithoutProviderTest extends AbstractSecurityProviderTest { @BeforeAll - public static void createSecurtyProviderConfigurationFile() throws Exception { + public static void createSecurtyProviderConfigurationFile() { URL location = MockSecurityProvider.class.getProtectionDomain().getCodeSource().getLocation(); File file = new File(location.getPath() + "META-INF/services/" + UndertowSecurityProvider.class.getName()); if (file.exists()) { @@ -45,7 +45,7 @@ public static void createSecurtyProviderConfigurationFile() throws Exception { } @Test - public void testSecuredNoProviderd() throws Exception { + public void testSecuredNoProviderd() { securityConfiguration.setRoleToAssign("user"); getMockEndpoint("mock:input").expectedHeaderReceived(Exchange.HTTP_METHOD, "GET"); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/TestClient.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/TestClient.java index a43f30a5175bf..6c35d83be2ffb 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/TestClient.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/TestClient.java @@ -61,7 +61,7 @@ public TestClient(String url, AsyncHttpClientConfig conf, int count) { this.url = url; } - public void connect() throws InterruptedException, ExecutionException, IOException { + public void connect() throws InterruptedException, ExecutionException { websocket = client.prepareGet(url).execute( new WebSocketUpgradeHandler.Builder() .addWebSocketListener(new TestWebSocketListener()).build()) diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsConsumerRouteTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsConsumerRouteTest.java index d4c6cf8dc266e..bdb35980ad8c1 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsConsumerRouteTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsConsumerRouteTest.java @@ -466,7 +466,7 @@ private String assertConnected(TestClient wsclient1) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { final int port = getPort(); @@ -492,7 +492,7 @@ public void configure() { .process(new Processor() { private final Set connectionKeys = new LinkedHashSet<>(); - public void process(final Exchange exchange) throws Exception { + public void process(final Exchange exchange) { final Message in = exchange.getIn(); final String connectionKey = in.getHeader(UndertowConstants.CONNECTION_KEY, String.class); diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsProducerRouteRestartTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsProducerRouteRestartTest.java index 330c48a341a5c..20bed94e088e9 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsProducerRouteRestartTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsProducerRouteRestartTest.java @@ -114,7 +114,7 @@ public void onError(Throwable t) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { from("direct:shop") // diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsProducerRouteTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsProducerRouteTest.java index 78aee63effd2b..c7d89ebbc8379 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsProducerRouteTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsProducerRouteTest.java @@ -92,7 +92,7 @@ public void onError(Throwable t) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { from("direct:shop").log(">>> Message received from Shopping center : ${body}") diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesTest.java index 248a99d368670..c4da6256eecaa 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesTest.java @@ -125,7 +125,7 @@ public void onError(Throwable t) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesToSameEndpointSendToAllHeaderTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesToSameEndpointSendToAllHeaderTest.java index 675ea3cb1a520..f3c8f5b131365 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesToSameEndpointSendToAllHeaderTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesToSameEndpointSendToAllHeaderTest.java @@ -87,7 +87,7 @@ public void onError(Throwable t) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesToSameEndpointTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesToSameEndpointTest.java index 9ca86a610cb8b..ef91cf2c906ca 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesToSameEndpointTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWsTwoRoutesToSameEndpointTest.java @@ -86,7 +86,7 @@ public void onError(Throwable t) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWssRouteTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWssRouteTest.java index bceb66568286c..6d0edbe7c13f3 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWssRouteTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/ws/UndertowWssRouteTest.java @@ -18,7 +18,6 @@ import java.io.IOException; import java.net.URL; -import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; @@ -65,7 +64,7 @@ public static void setUpJaas() throws Exception { } @AfterAll - public static void tearDownJaas() throws Exception { + public static void tearDownJaas() { System.clearProperty("java.security.auth.login.config"); } @@ -97,7 +96,7 @@ protected CamelContext createCamelContext() throws Exception { return context; } - protected AsyncHttpClient createAsyncHttpSSLClient() throws IOException, GeneralSecurityException { + protected AsyncHttpClient createAsyncHttpSSLClient() throws IOException { AsyncHttpClient c; AsyncHttpClientConfig config; @@ -165,7 +164,7 @@ public void onError(Throwable t) { } @Override - protected RouteBuilder createRouteBuilder() throws Exception { + protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { from("undertow:ws://localhost:" + getPort() + "/test")