Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private void createCamelContext() throws Exception {
final String queueEndpointName = "activemq:queue" + QUEUE_NAME;
camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
public void configure() {
from(queueEndpointName).bean(Consumer.class, "consume");
}
});
Expand All @@ -86,7 +86,7 @@ public void onContextStopped(CamelContext context) {
producerTemplate.sendBody(queueEndpointName, "message");
}

private void destroyCamelContext() throws Exception {
private void destroyCamelContext() {
LOG.info("destroying context");
camelContext.stop();
camelContext = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void testJmsTemplateUsesSingleConnectionFactory() throws Exception {
}

@Test
public void testSessionTransactedWithoutTransactionManager() throws Exception {
public void testSessionTransactedWithoutTransactionManager() {
JmsEndpoint endpoint = resolveMandatoryEndpoint("activemq:test.foo?transacted=true&lazyCreateTransactionManager=false");
JmsConfiguration configuration = endpoint.getConfiguration();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
public class ActiveMQJmsHeaderRouteForceTest extends ActiveMQJmsHeaderRouteTest {

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() throws Exception {
public void configure() {
// do not map jms message as we want to tamper with the JMS
// message directly, and not use the Camel API for that
from("activemq:test.a?mapJmsMessage=false").process(new Processor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ protected CamelContext createCamelContext() throws Exception {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() throws Exception {
public void configure() {
from("activemq:test.a").process(new Processor() {
public void process(Exchange exchange) throws Exception {
public void process(Exchange exchange) {
// lets set the custom JMS headers using the Camel API
exchange.getIn().setHeader("JMSReplyTo", replyQueue);
exchange.getIn().setHeader("JMSCorrelationID", correlationID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,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("activemq:queue:foo").to("activemq:queue:bar").to("mock:result");
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ protected CamelContext createCamelContext() throws Exception {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() throws Exception {
public void configure() {
from("activemq:test.a").to("activemq:test.b?preserveMessageQos=true");

from("activemq:test.b").to("mock:result");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ protected CamelContext createCamelContext() throws Exception {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() throws Exception {
public void configure() {
from(startEndpointUri).to("activemq:queue:test.b");
from("activemq:queue:test.b").to("mock:result");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public class ActiveMQToDSendDynamicTwoTest extends ActiveMQTestSupport {

@Test
public void testToD() throws Exception {
public void testToD() {
template.sendBodyAndHeader("direct:start", "Hello bar", "where", "bar");
template.sendBodyAndHeader("direct:start", "Hello beer", "where", "beer");
template.sendBodyAndHeader("direct:start", "Hello gin", "where", "gin");
Expand All @@ -40,10 +40,10 @@ public void testToD() throws Exception {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
public void configure() {
context.addComponent("activemq", activeMQComponent(vmUri("?broker.persistent=false")));

// route message dynamic using toD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ public class AdvisoryConsumerExampleTest extends ActiveMQTestSupport {
private static final Logger LOG = LoggerFactory.getLogger(AdvisoryConsumerExampleTest.class);

@Test
public void testWorks() throws Exception {
public void testWorks() {
// lets create a new queue
assertDoesNotThrow(
() -> template.sendBody("activemq:NewQueue." + System.currentTimeMillis(), "<hello>world!</hello>"));
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() throws Exception {
public void configure() {
context.addComponent("activemq", activeMQComponent(vmUri("?broker.persistent=false")));

// lets force the creation of a queue up front
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private void createCamelContext() throws Exception {
ActiveMQComponent.activeMQComponent(vmUri("?create=false&waitForStart=10000")));
camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
public void configure() {
from(fromEndpoint).to(toEndpoint);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private CamelContext createSenderContext() throws Exception {
camelContext.addComponent("activemq", amqComponent);
camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
public void configure() {
from(fromEndpoint).to(ExchangePattern.InOut, toEndpoint);
}
});
Expand All @@ -149,7 +149,7 @@ private CamelContext createBrokerCamelContext(String brokerName) throws Exceptio
ActiveMQComponent.activeMQComponent(vmUri(brokerName + "?create=false&waitForStart=1000")));
camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
public void configure() {
from(brokerEndpoint).setBody().simple("Returning ${body}")
.log("***Reply sent to ${header.JMSReplyTo} CoorId = ${header.JMSCorrelationID}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class InvokeRequestReplyUsingJmsReplyToHeaderTest extends ActiveMQTestSup
private MyServer myBean = new MyServer();

@Test
public void testPerformRequestReplyOverJms() throws Exception {
public void testPerformRequestReplyOverJms() {
Map<String, Object> headers = new HashMap<>();
headers.put("cheese", 123);
headers.put("JMSReplyTo", replyQueueName);
Expand Down Expand Up @@ -104,7 +104,7 @@ protected CamelContext createCamelContext() throws Exception {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
from("activemq:test.server").bean(myBean);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public ConnectionFactory createConnectionFactory(String options) {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
from("activemq:queue:hello").process(exchange -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void testMocksAreValid() throws Exception {
*/
public static class SetGroupIdProcessor implements Processor {
@Override
public void process(Exchange exchange) throws Exception {
public void process(Exchange exchange) {
// lets copy the IN to the OUT message
Message out = exchange.getMessage();
out.copyFrom(exchange.getIn());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected Map<String, String> getTranslationProperties() {
static class ConnectionLog implements Processor {

@Override
public void process(Exchange exchange) throws Exception {
public void process(Exchange exchange) {
if (consumed.getAndIncrement() == 0) {
firstConsumed.set(System.currentTimeMillis());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public void testCamelInvokesMessageListener() throws Exception {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() throws Exception {
public void configure() {
from("direct:start").bean(messageListener);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ protected CamelContext createCamelContext() throws Exception {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() throws Exception {
public void configure() {
from(startEndpointUri).bean(listener);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ public class AhcBridgeEndpointPathWithSpacesTest extends BaseAhcTest {
private int port2;

@Test
public void testBridgeEndpoint() throws Exception {
public void testBridgeEndpoint() {
String response = template.requestBodyAndHeader("http://localhost:" + port1 + "/test bar/hello",
new ByteArrayInputStream("This is a test".getBytes()), "Content-Type", "application/xml", String.class);
assertEquals("/proxy%20bar/hello", response, "Get a wrong response");
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
public void configure() {
port1 = getPort();
port2 = getNextPort();

Processor serviceProc = new Processor() {
public void process(Exchange exchange) throws Exception {
public void process(Exchange exchange) {
// get the request URL and copy it to the request body
String uri = exchange.getIn().getHeader(Exchange.HTTP_URI, String.class);
exchange.getMessage().setBody(uri);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class AhcBridgeEndpointTest extends BaseAhcTest {
private int port2;

@Test
public void testBridgeEndpoint() throws Exception {
public void testBridgeEndpoint() {
String response = template.requestBodyAndHeader("http://localhost:" + port1 + "/test/hello",
new ByteArrayInputStream("This is a test".getBytes()), "Content-Type", "application/xml", String.class);
assertEquals("/", response, "Get a wrong response");
Expand All @@ -51,15 +51,15 @@ public void testBridgeEndpoint() throws Exception {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
public void configure() {
port1 = getPort();
port2 = getNextPort();

Processor serviceProc = new Processor() {
public void process(Exchange exchange) throws Exception {
public void process(Exchange exchange) {
// get the request URL and copy it to the request body
String uri = exchange.getIn().getHeader(Exchange.HTTP_URI, String.class);
exchange.getMessage().setBody(uri);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class AhcClientConfigRealmUriTest extends BaseAhcTest {

@Test
public void testAhcProduce() throws Exception {
public void testAhcProduce() {
Object out = template.requestBody(getAhcEndpointUri()
+ "?clientConfig.realm.scheme=DIGEST&clientConfig.realm.principal=someUser"
+ "&clientConfig.realm.password=somePass&clientConfig.realm.usePreemptiveAuth=true",
Expand All @@ -33,10 +33,10 @@ public void testAhcProduce() throws Exception {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
public void configure() {
from(getTestServerEndpointUri())
.transform(constant("Bye World"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
public class AhcClientConfigUriTest extends BaseAhcTest {

@Test
public void testAhcProduce() throws Exception {
public void testAhcProduce() {
Object out = template.requestBody(getAhcEndpointUri() + "?clientConfig.maxRedirects=4", null, String.class);
assertEquals("Bye World", out);
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
public void configure() {
from(getTestServerEndpointUri())
.transform(constant("Bye World"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public void testAhcComponentClientConfig() throws Exception {
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
public void configure() {
configureComponent();

from("direct:start")
Expand All @@ -61,7 +61,7 @@ public void configure() throws Exception {

from(getTestServerEndpointUri())
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
public void process(Exchange exchange) {
// redirect to test the client config worked as we told it to follow redirects
exchange.getMessage().setHeader(Exchange.HTTP_RESPONSE_CODE, "301");
exchange.getMessage().setHeader("Location", getTestServerEndpointTwoUrl());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ public void testAhcComponentCustomClientConfig() throws Exception {
}

@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(getAhcEndpointUri())
.to("mock:result");

from(getTestServerEndpointUri())
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
public void process(Exchange exchange) {
// redirect to test the client config worked as we told it to follow redirects
exchange.getMessage().setHeader(Exchange.HTTP_RESPONSE_CODE, "301");
exchange.getMessage().setHeader("Location", getTestServerEndpointTwoUrl());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ public void testAhcComponentCustomClientConfig() throws Exception {
}

@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(getAhcEndpointUri())
.to("mock:result");

from(getTestServerEndpointUri())
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
public void process(Exchange exchange) {
// redirect to test the client config worked as we told it to follow redirects
exchange.getMessage().setHeader(Exchange.HTTP_RESPONSE_CODE, "301");
exchange.getMessage().setHeader("Location", getTestServerEndpointTwoUrl());
Expand Down
Loading