You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/07/30 13:38:15 UTC
[camel] 02/03: CAMEL-13801 - Fixed CS for Camel-paho
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 86843171266dad4e3908557bf99658d472ad8d8a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 30 15:36:31 2019 +0200
CAMEL-13801 - Fixed CS for Camel-paho
---
.../camel/component/paho/PahoComponentTest.java | 21 +++++++--------------
.../camel/component/paho/PahoOverrideTopicTest.java | 2 +-
2 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
index b54a08c..bcc4d7a 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
@@ -34,7 +34,7 @@ import org.junit.Test;
public class PahoComponentTest extends CamelTestSupport {
- @BindToRegistry("connectOptions")
+ @BindToRegistry("connectOptions")
MqttConnectOptions connectOptions = new MqttConnectOptions();
@EndpointInject("mock:test")
@@ -95,11 +95,7 @@ public class PahoComponentTest extends CamelTestSupport {
@Test
public void checkOptions() {
- String uri = "paho:/test/topic"
- + "?clientId=sampleClient"
- + "&brokerUrl=tcp://localhost:" + mqttPort
- + "&qos=2"
- + "&persistence=file";
+ String uri = "paho:/test/topic" + "?clientId=sampleClient" + "&brokerUrl=tcp://localhost:" + mqttPort + "&qos=2" + "&persistence=file";
PahoEndpoint endpoint = getMandatoryEndpoint(uri, PahoEndpoint.class);
@@ -139,9 +135,8 @@ public class PahoComponentTest extends CamelTestSupport {
@Test
public void shouldUseConnectionOptionsFromRegistry() {
// Given
- PahoEndpoint pahoWithConnectOptionsFromRegistry = getMandatoryEndpoint(
- "paho:registryConnectOptions?connectOptions=#connectOptions&brokerUrl=tcp://localhost:" + mqttPort,
- PahoEndpoint.class);
+ PahoEndpoint pahoWithConnectOptionsFromRegistry = getMandatoryEndpoint("paho:registryConnectOptions?connectOptions=#connectOptions&brokerUrl=tcp://localhost:" + mqttPort,
+ PahoEndpoint.class);
// Then
assertSame(connectOptions, pahoWithConnectOptionsFromRegistry.resolveMqttConnectOptions());
@@ -150,9 +145,7 @@ public class PahoComponentTest extends CamelTestSupport {
@Test
public void shouldAutomaticallyUseConnectionOptionsFromRegistry() {
// Given
- PahoEndpoint pahoWithConnectOptionsFromRegistry = getMandatoryEndpoint(
- "paho:registryConnectOptions?brokerUrl=tcp://localhost:" + mqttPort,
- PahoEndpoint.class);
+ PahoEndpoint pahoWithConnectOptionsFromRegistry = getMandatoryEndpoint("paho:registryConnectOptions?brokerUrl=tcp://localhost:" + mqttPort, PahoEndpoint.class);
// Then
assertSame(connectOptions, pahoWithConnectOptionsFromRegistry.resolveMqttConnectOptions());
@@ -171,7 +164,7 @@ public class PahoComponentTest extends CamelTestSupport {
mock.assertIsSatisfied();
Exchange exchange = mock.getExchanges().get(0);
- String payload = new String((byte[]) exchange.getIn().getBody(), "utf-8");
+ String payload = new String((byte[])exchange.getIn().getBody(), "utf-8");
assertEquals("queue", exchange.getIn().getHeader(PahoConstants.MQTT_TOPIC));
assertEquals(msg, payload);
@@ -219,5 +212,5 @@ public class PahoComponentTest extends CamelTestSupport {
// Then
mock.assertIsSatisfied();
}
-
+
}
diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
index 7804b46..36ac07d 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
@@ -28,7 +28,7 @@ import org.junit.Test;
public class PahoOverrideTopicTest extends CamelTestSupport {
- @BindToRegistry("connectOptions")
+ @BindToRegistry("connectOptions")
MqttConnectOptions connectOptions = new MqttConnectOptions();
BrokerService broker;