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 2018/09/05 06:10:04 UTC
[camel] branch master updated (6223c79 -> 46ae4f4)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.
from 6223c79 CAMEL-12756: Fixed spring boot name of property in conditional on property must use dash syntax.
new fde4584 CAMEL-12774 - Camel-elasticsearch-rest: Error during type conversion from type: java.lang.String to the required type: org.elasticsearch.action.update.UpdateRequest
new 46ae4f4 CAMEL-12774 - Fixed CS
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../converter/ElasticsearchActionRequestConverter.java | 2 +-
.../component/elasticsearch/ElasticsearchBaseTest.java | 2 --
.../elasticsearch/ElasticsearchClusterBaseTest.java | 2 --
.../ElasticsearchGetSearchDeleteExistsUpdateTest.java | 14 ++++++++++++++
4 files changed, 15 insertions(+), 5 deletions(-)
[camel] 02/02: CAMEL-12774 - Fixed CS
Posted by ac...@apache.org.
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 46ae4f4975647f1d5f8b794fbe8d1721b0b3964b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Sep 5 08:08:27 2018 +0200
CAMEL-12774 - Fixed CS
---
.../org/apache/camel/component/elasticsearch/ElasticsearchBaseTest.java | 2 --
.../camel/component/elasticsearch/ElasticsearchClusterBaseTest.java | 2 --
2 files changed, 4 deletions(-)
diff --git a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBaseTest.java b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBaseTest.java
index 9fd2030..07b954c 100644
--- a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBaseTest.java
+++ b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchBaseTest.java
@@ -15,8 +15,6 @@
* limitations under the License.
*/
package org.apache.camel.component.elasticsearch;
-import org.junit.Before;
-import org.junit.After;
import java.io.IOException;
import java.net.InetAddress;
diff --git a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchClusterBaseTest.java b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchClusterBaseTest.java
index f971917..22ddfb8 100644
--- a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchClusterBaseTest.java
+++ b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchClusterBaseTest.java
@@ -15,8 +15,6 @@
* limitations under the License.
*/
package org.apache.camel.component.elasticsearch;
-import org.junit.Before;
-import org.junit.After;
import java.net.InetAddress;
import java.util.HashMap;
[camel] 01/02: CAMEL-12774 - Camel-elasticsearch-rest: Error during
type conversion from type: java.lang.String to the required type:
org.elasticsearch.action.update.UpdateRequest
Posted by ac...@apache.org.
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 fde4584efe2e9bc4adc78690a04e4b1083bf27ae
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Sep 5 08:00:30 2018 +0200
CAMEL-12774 - Camel-elasticsearch-rest: Error during type conversion from type: java.lang.String to the required type: org.elasticsearch.action.update.UpdateRequest
---
.../converter/ElasticsearchActionRequestConverter.java | 2 +-
.../ElasticsearchGetSearchDeleteExistsUpdateTest.java | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
index 5dfce04..aea664e 100644
--- a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
+++ b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java
@@ -59,7 +59,7 @@ public final class ElasticsearchActionRequestConverter {
} else if (document instanceof Map) {
updateRequest.doc((Map<String, Object>) document);
} else if (document instanceof String) {
- updateRequest.doc((String) document);
+ updateRequest.doc((String) document, XContentFactory.xContent((String) document));
} else if (document instanceof XContentBuilder) {
updateRequest.doc((XContentBuilder) document);
} else {
diff --git a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java
index c97064d..be4d98b 100644
--- a/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java
+++ b/components/camel-elasticsearch-rest/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java
@@ -270,6 +270,20 @@ public class ElasticsearchGetSearchDeleteExistsUpdateTest extends ElasticsearchB
// then
assertThat(response, notNullValue());
}
+
+ @Test
+ public void testStringUpdate() throws Exception {
+ Map<String, String> map = createIndexedData();
+ String indexId = template.requestBody("direct:index", map, String.class);
+ assertNotNull("indexId should be set", indexId);
+
+ String body = "{\"id\" : 1}";
+
+ Map<String, Object> headers = new HashMap<>();
+ headers.put(ElasticsearchConstants.PARAM_INDEX_ID, indexId);
+ indexId = template.requestBodyAndHeaders("direct:update", body, headers, String.class);
+ assertNotNull("indexId should be set", indexId);
+ }
@Override
protected RouteBuilder createRouteBuilder() throws Exception {