You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pa...@apache.org on 2018/06/03 07:03:22 UTC

[camel] branch master updated: camel-zookeeper: fix checkstyle violations in tests

This is an automated email from the ASF dual-hosted git repository.

pascalschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new c4fe82b  camel-zookeeper: fix checkstyle violations in tests
c4fe82b is described below

commit c4fe82b95f1ef90d6460f1f0488e2e3331ca322e
Author: Pascal Schumacher <pa...@gmx.net>
AuthorDate: Sun Jun 3 09:02:39 2018 +0200

    camel-zookeeper: fix checkstyle violations in tests
---
 .../component/zookeeper/cloud/ZooKeeperServiceRegistry.java    |  2 +-
 .../zookeeper/cloud/ZooKeeperServiceRegistrationTestBase.java  | 10 +++++-----
 .../ZooKeeperServiceRegistrationWithServiceComponentTest.java  |  6 ++----
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistry.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistry.java
index 89fb08d..fbfe252 100644
--- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistry.java
+++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistry.java
@@ -359,7 +359,7 @@ public class ZooKeeperServiceRegistry extends AbstractServiceRegistry {
                     serviceDiscovery.unregisterService(serviceInstance);
 
                     // remove the serviceId to the list of known server
-                    serviceList.remove((serviceInstance.getId()));
+                    serviceList.remove(serviceInstance.getId());
                 }
             }
         } catch (Exception e) {
diff --git a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationTestBase.java b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationTestBase.java
index 99b08a1..d9d9673 100644
--- a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationTestBase.java
+++ b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationTestBase.java
@@ -37,12 +37,12 @@ import org.apache.curator.x.discovery.details.JsonInstanceSerializer;
 import org.junit.Test;
 
 public abstract class ZooKeeperServiceRegistrationTestBase extends CamelTestSupport {
-    protected final static String SERVICE_ID = UUID.randomUUID().toString();
-    protected final static String SERVICE_NAME = "my-service";
-    protected final static String SERVICE_HOST = "localhost";
+    protected static final String SERVICE_ID = UUID.randomUUID().toString();
+    protected static final String SERVICE_NAME = "my-service";
+    protected static final String SERVICE_HOST = "localhost";
     protected static final String SERVICE_PATH = "/camel";
-    protected final static int SERVICE_PORT = AvailablePortFinder.getNextAvailable();
-    protected final static int SERVER_PORT = AvailablePortFinder.getNextAvailable();
+    protected static final int SERVICE_PORT = AvailablePortFinder.getNextAvailable();
+    protected static final int SERVER_PORT = AvailablePortFinder.getNextAvailable();
 
     protected ZooKeeperTestSupport.TestZookeeperServer server;
     protected CuratorFramework curator;
diff --git a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationWithServiceComponentTest.java b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationWithServiceComponentTest.java
index 23d70b7..1099c19 100644
--- a/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationWithServiceComponentTest.java
+++ b/components/camel-zookeeper/src/test/java/org/apache/camel/component/zookeeper/cloud/ZooKeeperServiceRegistrationWithServiceComponentTest.java
@@ -16,7 +16,7 @@
  */
 package org.apache.camel.component.zookeeper.cloud;
 
-import java.util.HashMap;
+import java.util.Collections;
 import java.util.Map;
 
 import org.apache.camel.RoutesBuilder;
@@ -27,9 +27,7 @@ import org.apache.camel.impl.JndiRegistry;
 public class ZooKeeperServiceRegistrationWithServiceComponentTest extends ZooKeeperServiceRegistrationTestBase {
 
     protected Map<String, String> getMetadata() {
-        return new HashMap<String, String>() {{
-            put("service.type", "zookeeper");
-        }};
+        return Collections.singletonMap("service.type", "zookeeper");
     }
 
     @Override

-- 
To stop receiving notification emails like this one, please contact
pascalschumacher@apache.org.