You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/04/12 10:27:48 UTC
[camel] 08/09: CAMEL-17763: cleanup unused exceptions in camel-irc
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit f5e6d2dc44c7c480bc8c5ab0e4c916e4a60ca7ec
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Apr 12 11:11:30 2022 +0200
CAMEL-17763: cleanup unused exceptions in camel-irc
---
.../test/java/org/apache/camel/component/irc/IrcEndpointTest.java | 8 ++++----
.../test/java/org/apache/camel/component/irc/IrcProducerTest.java | 6 +++---
.../apache/camel/component/irc/it/IrcMultiChannelRouteTest.java | 4 ++--
.../java/org/apache/camel/component/irc/it/IrcOnReplyTest.java | 6 +++---
.../java/org/apache/camel/component/irc/it/IrcPrivmsgTest.java | 6 +++---
.../test/java/org/apache/camel/component/irc/it/IrcRouteTest.java | 6 +++---
.../java/org/apache/camel/component/irc/it/IrcsListUsersTest.java | 4 ++--
.../camel/component/irc/it/IrcsWithSslContextParamsRouteTest.java | 2 +-
8 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcEndpointTest.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcEndpointTest.java
index 4e8ca053618..f4f9abde2c0 100644
--- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcEndpointTest.java
+++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcEndpointTest.java
@@ -55,26 +55,26 @@ public class IrcEndpointTest {
}
@Test
- public void doJoinChannelTestNoKey() throws Exception {
+ public void doJoinChannelTestNoKey() {
endpoint.joinChannel("#chan1");
verify(connection).doJoin("#chan1");
}
@Test
- public void doJoinChannelTestKey() throws Exception {
+ public void doJoinChannelTestKey() {
endpoint.joinChannel("#chan2");
verify(connection).doJoin("#chan2", "chan2key");
}
@Test
- public void doJoinChannels() throws Exception {
+ public void doJoinChannels() {
endpoint.joinChannels();
verify(connection).doJoin("#chan1");
verify(connection).doJoin("#chan2", "chan2key");
}
@Test
- public void doHandleIrcErrorNickInUse() throws Exception {
+ public void doHandleIrcErrorNickInUse() {
when(connection.getNick()).thenReturn("nick");
endpoint.handleIrcError(IRCConstants.ERR_NICKNAMEINUSE, "foo");
diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcProducerTest.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcProducerTest.java
index 6b9cc180100..0f7d85cfa6d 100644
--- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcProducerTest.java
+++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcProducerTest.java
@@ -68,7 +68,7 @@ public class IrcProducerTest {
}
@Test
- public void doStopTest() throws Exception {
+ public void doStopTest() {
producer.stop();
verify(connection).doPart("#chan1");
verify(connection).doPart("#chan2");
@@ -76,7 +76,7 @@ public class IrcProducerTest {
}
@Test
- public void doStartTest() throws Exception {
+ public void doStartTest() {
producer.start();
verify(connection).addIRCEventListener(listener);
@@ -107,7 +107,7 @@ public class IrcProducerTest {
}
@Test
- public void processTestException() throws Exception {
+ public void processTestException() {
when(exchange.getIn()).thenReturn(message);
when(message.getBody(String.class)).thenReturn("PART foo");
diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcMultiChannelRouteTest.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcMultiChannelRouteTest.java
index c2c69ce0e90..539de3fb686 100644
--- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcMultiChannelRouteTest.java
+++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcMultiChannelRouteTest.java
@@ -60,9 +60,9 @@ public class IrcMultiChannelRouteTest extends IrcIntegrationTestSupport {
}
@Override
- protected RouteBuilder createRouteBuilder() throws Exception {
+ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
- public void configure() throws Exception {
+ public void configure() {
from(fromUri()).choice().when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualTo("PRIVMSG")).to("direct:mock")
.when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualTo("JOIN")).to(joined);
diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcOnReplyTest.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcOnReplyTest.java
index 75e4d5d125c..a75df9f02f5 100644
--- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcOnReplyTest.java
+++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcOnReplyTest.java
@@ -47,14 +47,14 @@ public class IrcOnReplyTest extends IrcIntegrationTestSupport {
}
@Override
- protected RouteBuilder createRouteBuilder() throws Exception {
+ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
- public void configure() throws Exception {
+ public void configure() {
from(fromUri()).choice().when(header(IrcConstants.IRC_NUM).isEqualTo(315)).to("mock:result")
.when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualTo("JOIN")).to("seda:consumerJoined");
from("seda:consumerJoined").process(new Processor() {
- public void process(Exchange exchange) throws Exception {
+ public void process(Exchange exchange) {
sendMessages();
}
});
diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcPrivmsgTest.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcPrivmsgTest.java
index 72bbcdb51d2..4d74c1c574c 100644
--- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcPrivmsgTest.java
+++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcPrivmsgTest.java
@@ -51,9 +51,9 @@ public class IrcPrivmsgTest extends IrcIntegrationTestSupport {
}
@Override
- protected RouteBuilder createRouteBuilder() throws Exception {
+ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
- public void configure() throws Exception {
+ public void configure() {
from(fromUri()).choice().when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualTo("PRIVMSG")).to("direct:mock")
.when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualTo("JOIN")).to("seda:consumerJoined");
@@ -77,7 +77,7 @@ public class IrcPrivmsgTest extends IrcIntegrationTestSupport {
/**
* Lets send messages once the consumer has joined
*/
- protected void sendMessages() throws InterruptedException {
+ protected void sendMessages() {
if (!sentMessages) {
sentMessages = true;
diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcRouteTest.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcRouteTest.java
index 07c6540cff4..e124ffde138 100644
--- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcRouteTest.java
+++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcRouteTest.java
@@ -56,15 +56,15 @@ public class IrcRouteTest extends IrcIntegrationTestSupport {
}
@Override
- protected RouteBuilder createRouteBuilder() throws Exception {
+ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
- public void configure() throws Exception {
+ public void configure() {
from(fromUri()).choice().when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualTo("PRIVMSG"))
.to("direct:mock").when(header(IrcConstants.IRC_MESSAGE_TYPE).isEqualTo("JOIN"))
.to("seda:consumerJoined");
from("seda:consumerJoined").process(new Processor() {
- public void process(Exchange exchange) throws Exception {
+ public void process(Exchange exchange) {
sendMessages();
}
});
diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsListUsersTest.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsListUsersTest.java
index 8e289bf528e..cf76373556b 100644
--- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsListUsersTest.java
+++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsListUsersTest.java
@@ -40,12 +40,12 @@ public class IrcsListUsersTest extends IrcIntegrationTestSupport {
private static final String PRODUCER_URI = "ircs:{{camelFrom}}@{{server}}/{{channel1}}";
@Override
- protected RoutesBuilder createRouteBuilder() throws Exception {
+ protected RoutesBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
- public void configure() throws Exception {
+ public void configure() {
LOGGER.debug("Creating new test route");
from(PRODUCER_URI + "?namesOnJoin=true&onReply=true")
diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsWithSslContextParamsRouteTest.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsWithSslContextParamsRouteTest.java
index 99e87fee23f..4d20ec5805d 100644
--- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsWithSslContextParamsRouteTest.java
+++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/it/IrcsWithSslContextParamsRouteTest.java
@@ -37,7 +37,7 @@ public class IrcsWithSslContextParamsRouteTest extends IrcRouteTest {
// when camel-con joins the room.
@BindToRegistry("sslContextParameters")
- protected SSLContextParameters loadSslContextParams() throws Exception {
+ protected SSLContextParameters loadSslContextParams() {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("localhost.p12");
ksp.setPassword("changeit");