You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/10/16 18:50:44 UTC

[5/7] camel git commit: CAMEL-11868: Fixed CS

CAMEL-11868: Fixed CS


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9b60081c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9b60081c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9b60081c

Branch: refs/heads/master
Commit: 9b60081c049cbc89413e6497023f514fb6e0303a
Parents: 3f2ef73
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Oct 16 20:41:13 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Oct 16 20:41:13 2017 +0200

----------------------------------------------------------------------
 .../component/elasticsearch5/ElasticsearchBaseTest.java      | 6 +++---
 .../component/elasticsearch5/ElasticsearchBulkTest.java      | 4 ++--
 .../elasticsearch5/ElasticsearchClusterBaseTest.java         | 2 +-
 .../elasticsearch5/ElasticsearchClusterIndexTest.java        | 4 +---
 .../ElasticsearchGetSearchDeleteExistsUpdateTest.java        | 8 ++++----
 .../component/elasticsearch5/ElasticsearchIndexTest.java     | 3 +--
 6 files changed, 12 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9b60081c/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchBaseTest.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchBaseTest.java b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchBaseTest.java
index f0496e5..a9cf79c 100644
--- a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchBaseTest.java
+++ b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchBaseTest.java
@@ -40,7 +40,7 @@ public class ElasticsearchBaseTest extends CamelTestSupport {
     public static RestClient client;
 
     protected static final int ES_BASE_TRANSPORT_PORT = AvailablePortFinder.getNextAvailable();
-    protected static final int ES_BASE_HTTP_PORT = AvailablePortFinder.getNextAvailable(ES_BASE_TRANSPORT_PORT+1);
+    protected static final int ES_BASE_HTTP_PORT = AvailablePortFinder.getNextAvailable(ES_BASE_TRANSPORT_PORT + 1);
 
     @SuppressWarnings("resource")
     @BeforeClass
@@ -61,7 +61,7 @@ public class ElasticsearchBaseTest extends CamelTestSupport {
 
         // wait for green status
         runner.ensureGreen();
-        client = RestClient.builder(new HttpHost(InetAddress.getByName("localhost"),ES_BASE_HTTP_PORT)).build();
+        client = RestClient.builder(new HttpHost(InetAddress.getByName("localhost"), ES_BASE_HTTP_PORT)).build();
     }
 
     @AfterClass
@@ -84,7 +84,7 @@ public class ElasticsearchBaseTest extends CamelTestSupport {
     protected CamelContext createCamelContext() throws Exception {
         CamelContext context = super.createCamelContext();
         final ElasticsearchComponent elasticsearchComponent = new ElasticsearchComponent();
-        elasticsearchComponent.setHostAddresses("localhost:"+ES_BASE_HTTP_PORT);
+        elasticsearchComponent.setHostAddresses("localhost:" + ES_BASE_HTTP_PORT);
         context.addComponent("elasticsearch5-rest", elasticsearchComponent);
         return context;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/9b60081c/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchBulkTest.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchBulkTest.java b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchBulkTest.java
index 979c71c..bfc9cc5 100644
--- a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchBulkTest.java
+++ b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchBulkTest.java
@@ -54,8 +54,8 @@ public class ElasticsearchBulkTest extends ElasticsearchBaseTest {
         // given
         List<Map<String, String>> request = new ArrayList<>();
         final HashMap<String, String> valueMap = new HashMap<>();
-        valueMap.put("id",prefix+"baz");
-        valueMap.put("content",prefix + "hello");
+        valueMap.put("id", prefix + "baz");
+        valueMap.put("content", prefix + "hello");
         request.add(valueMap);
         // when
         @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/camel/blob/9b60081c/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchClusterBaseTest.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchClusterBaseTest.java b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchClusterBaseTest.java
index 6ecd3f9..e0225f9 100644
--- a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchClusterBaseTest.java
+++ b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchClusterBaseTest.java
@@ -63,7 +63,7 @@ public class ElasticsearchClusterBaseTest extends CamelTestSupport {
 
         // wait for green status
         runner.ensureGreen();
-        restclient = RestClient.builder(new HttpHost(InetAddress.getByName("localhost"),ES_FIRST_NODE_TRANSPORT_PORT)).build();
+        restclient = RestClient.builder(new HttpHost(InetAddress.getByName("localhost"), ES_FIRST_NODE_TRANSPORT_PORT)).build();
         client = new RestHighLevelClient(restclient);
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/9b60081c/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchClusterIndexTest.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchClusterIndexTest.java b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchClusterIndexTest.java
index b0430d0..6c70f46 100644
--- a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchClusterIndexTest.java
+++ b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchClusterIndexTest.java
@@ -70,11 +70,9 @@ public class ElasticsearchClusterIndexTest extends ElasticsearchClusterBaseTest
 
         final BasicResponseHandler responseHandler = new BasicResponseHandler();
         String body = responseHandler.handleEntity(restclient.performRequest("GET", "/_cluster/health?pretty").getEntity());
-        assertStringContains(body,"\"number_of_data_nodes\" : 3");
-
+        assertStringContains(body, "\"number_of_data_nodes\" : 3");
     }
 
-
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {

http://git-wip-us.apache.org/repos/asf/camel/blob/9b60081c/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchGetSearchDeleteExistsUpdateTest.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchGetSearchDeleteExistsUpdateTest.java b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchGetSearchDeleteExistsUpdateTest.java
index 9fdb329..61d4d09 100644
--- a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchGetSearchDeleteExistsUpdateTest.java
+++ b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchGetSearchDeleteExistsUpdateTest.java
@@ -89,9 +89,9 @@ public class ElasticsearchGetSearchDeleteExistsUpdateTest extends ElasticsearchB
         match.put("match", actualQuery);
         Map<String, Object> query = new HashMap<>();
         query.put("query", match);
-        SearchHits response = template.requestBody("direct:search", query,SearchHits.class);
+        SearchHits response = template.requestBody("direct:search", query, SearchHits.class);
         assertNotNull("response should not be null", response);
-        assertEquals("response hits should be == 1",1, response.totalHits);
+        assertEquals("response hits should be == 1", 1, response.totalHits);
     }
         
     @Test
@@ -203,8 +203,8 @@ public class ElasticsearchGetSearchDeleteExistsUpdateTest extends ElasticsearchB
 
         //now, perform Delete
         headers.put(ElasticsearchConstants.PARAM_OPERATION, ElasticsearchOperation.Delete);
-        DocWriteResponse.Result deleteResponse = template.requestBodyAndHeaders("direct:start", indexId, headers,DocWriteResponse.Result.class);
-        assertEquals("response should not be null",DocWriteResponse.Result.DELETED, deleteResponse);
+        DocWriteResponse.Result deleteResponse = template.requestBodyAndHeaders("direct:start", indexId, headers, DocWriteResponse.Result.class);
+        assertEquals("response should not be null", DocWriteResponse.Result.DELETED, deleteResponse);
 
         //now, verify GET fails to find the indexed value
         headers.put(ElasticsearchConstants.PARAM_OPERATION, ElasticsearchOperation.GetById);

http://git-wip-us.apache.org/repos/asf/camel/blob/9b60081c/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchIndexTest.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchIndexTest.java b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchIndexTest.java
index ea17836..469f8bf 100644
--- a/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchIndexTest.java
+++ b/components/camel-elasticsearch5-rest/src/test/java/org/apache/camel/component/elasticsearch5/ElasticsearchIndexTest.java
@@ -38,10 +38,9 @@ public class ElasticsearchIndexTest extends ElasticsearchBaseTest {
         assertNotNull("indexId should be set", indexId);
 
         int status = template.requestBody("direct:deleteIndex", "", Integer.class);
-        assertEquals("status should be 200",200, status);
+        assertEquals("status should be 200", 200, status);
     }
 
-
     @Test
     public void testIndexWithReplication() throws Exception {
         Map<String, String> map = createIndexedData();