From e007fee9fb76a03b63442662ece07fa1c8c71d4e Mon Sep 17 00:00:00 2001 From: Jack Conradson Date: Thu, 20 Jul 2017 08:51:27 -0700 Subject: [PATCH] remove lang url parameter from stored script requests (elastic/x-pack-elasticsearch#2029) Original commit: elastic/x-pack-elasticsearch@1044c3ba537588ae1f49a79d7a328b6e06d22095 --- .../xpack/watcher/test/integration/BasicWatcherTests.java | 1 - .../xpack/watcher/transform/TransformIntegrationTests.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java b/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java index b9f13ff1c8e..9f1824a846e 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java @@ -230,7 +230,6 @@ public class BasicWatcherTests extends AbstractWatcherIntegrationTestCase { public void testConditionSearchWithIndexedTemplate() throws Exception { SearchSourceBuilder searchSourceBuilder = searchSource().query(matchQuery("level", "a")); assertAcked(client().admin().cluster().preparePutStoredScript() - .setLang("mustache") .setId("my-template") .setContent(jsonBuilder().startObject().field("template").value(searchSourceBuilder).endObject().bytes(), XContentType.JSON) .get()); diff --git a/plugin/src/test/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java b/plugin/src/test/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java index b1282264175..4e15109d888 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java @@ -120,8 +120,8 @@ public class TransformIntegrationTests extends AbstractWatcherIntegrationTestCas logger.info("testing script transform with an indexed script"); assertAcked(client().admin().cluster().preparePutStoredScript() .setId("my-script") - .setLang("mockscript") - .setContent(new BytesArray("{\"script\" : \"['key3' : ctx.payload.key1 + ctx.payload.key2]\"}"), XContentType.JSON) + .setContent(new BytesArray("{\"script\" : {\"lang\": \"" + MockScriptPlugin.NAME + "\", " + + "\"source\": \"['key3' : ctx.payload.key1 + ctx.payload.key2]\"}"), XContentType.JSON) .get()); script = new Script(ScriptType.STORED, null, "my-script", Collections.emptyMap()); }