Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
public class TelegramChatBotTest extends TelegramTestSupport {

@Test
public void testChatBotResult() throws Exception {
public void testChatBotResult() {

List<OutgoingTextMessage> msgs = Awaitility.await().atMost(5, TimeUnit.SECONDS)
.until(() -> getMockRoutes().getMock("sendMessage").getRecordedMessages(),
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
} };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand All @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
} };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class TelegramProducerChatIdResolutionTest extends TelegramTestSupport {
private Endpoint endpoint;

@Test
public void testRouteWithFixedChatId() throws Exception {
public void testRouteWithFixedChatId() {
final MockProcessor<OutgoingTextMessage> mockProcessor = getMockRoutes().getMock("sendMessage");
mockProcessor.clearRecordedMessages();

Expand All @@ -53,7 +53,7 @@ public void testRouteWithFixedChatId() throws Exception {
}

@Test
public void testRouteWithOverridenChatId() throws Exception {
public void testRouteWithOverridenChatId() {
final MockProcessor<OutgoingTextMessage> mockProcessor = getMockRoutes().getMock("sendMessage");
mockProcessor.clearRecordedMessages();

Expand All @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void testStopMessageLiveLocation() {
}

@Override
protected RoutesBuilder[] createRouteBuilders() throws Exception {
protected RoutesBuilder[] createRouteBuilders() {
return new RoutesBuilder[] {
getMockRoutes(),
new RouteBuilder() {
Expand Down
Loading