From 73c5c1576f59093ea6111595f02a2f62ef67e71d Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 16 Mar 2017 21:17:02 +0100 Subject: [PATCH] [TEST] Added logging and removed unneeded jackson-databind test dependency. Original commit: elastic/x-pack-elasticsearch@58c247d69613a6444dabace1946045e97e6623c7 --- qa/ml-single-node-tests/build.gradle | 1 - .../xpack/ml/transforms/PainlessDomainSplitIT.java | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/qa/ml-single-node-tests/build.gradle b/qa/ml-single-node-tests/build.gradle index ae6c0374b21..12d303e11b7 100644 --- a/qa/ml-single-node-tests/build.gradle +++ b/qa/ml-single-node-tests/build.gradle @@ -3,7 +3,6 @@ apply plugin: 'elasticsearch.rest-test' dependencies { testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'runtime') - testCompile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.6' } integTestCluster { diff --git a/qa/ml-single-node-tests/src/test/java/org/elasticsearch/xpack/ml/transforms/PainlessDomainSplitIT.java b/qa/ml-single-node-tests/src/test/java/org/elasticsearch/xpack/ml/transforms/PainlessDomainSplitIT.java index 83575bcb0ef..098dff3d0fe 100644 --- a/qa/ml-single-node-tests/src/test/java/org/elasticsearch/xpack/ml/transforms/PainlessDomainSplitIT.java +++ b/qa/ml-single-node-tests/src/test/java/org/elasticsearch/xpack/ml/transforms/PainlessDomainSplitIT.java @@ -5,7 +5,6 @@ */ package org.elasticsearch.xpack.ml.transforms; -import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.util.EntityUtils; @@ -27,6 +26,7 @@ import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; @@ -197,7 +197,6 @@ public class PainlessDomainSplitIT extends ESRestTestCase { } public void testIsolated() throws Exception { - Settings.Builder settings = Settings.builder() .put(IndexMetaData.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) .put(IndexMetaData.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0); @@ -213,7 +212,8 @@ public class PainlessDomainSplitIT extends ESRestTestCase { params.putAll(DomainSplitFunction.params); for (TestConfiguration testConfig : tests) { params.put("host", testConfig.hostName); - String mapAsJson = new ObjectMapper().writeValueAsString(params); + String mapAsJson = jsonBuilder().map(params).string(); + logger.info("params={}", mapAsJson); StringEntity body = new StringEntity("{\n" + " \"query\" : {\n" +