From 36486a79931112fa364093434f428c6d863d1e7a Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Tue, 6 Sep 2016 07:17:38 +0200 Subject: [PATCH] Changes for PR: https://github.com/elastic/elasticsearch/pull/20310 Original commit: elastic/x-pack-elasticsearch@9db3d05274972b68c4bf69aa539d7949d9c23399 --- .../org/elasticsearch/xpack/common/text/TextTemplate.java | 4 ++-- .../watcher/test/AbstractWatcherIntegrationTestCase.java | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/text/TextTemplate.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/text/TextTemplate.java index e7525ae1367..a3c31fac856 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/text/TextTemplate.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/text/TextTemplate.java @@ -37,7 +37,7 @@ public class TextTemplate implements ToXContent { public TextTemplate(String template, @Nullable XContentType contentType, ScriptType type, @Nullable Map params) { - this.script = new Script(template, type, null, params, contentType); + this.script = new Script(template, type, "mustache", params, contentType); this.inlineTemplate = null; } @@ -95,7 +95,7 @@ public class TextTemplate implements ToXContent { if (parser.currentToken() == XContentParser.Token.VALUE_STRING) { return new TextTemplate(parser.text()); } else { - return new TextTemplate(Script.parse(parser, ParseFieldMatcher.STRICT, null)); + return new TextTemplate(Script.parse(parser, ParseFieldMatcher.STRICT, "mustache")); } } } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java index c0358ecfa7b..70601128b78 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java @@ -25,6 +25,7 @@ import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.env.Environment; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.license.XPackLicenseState; +import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptSettings; import org.elasticsearch.xpack.XPackSettings; import org.elasticsearch.plugins.Plugin; @@ -102,12 +103,10 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNot.not; -/** - */ @ClusterScope(scope = SUITE, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false, maxNumDataNodes = 3) public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase { - public static final String WATCHER_LANG = ScriptSettings.DEFAULT_LANG; + public static final String WATCHER_LANG = Script.DEFAULT_SCRIPT_LANG; private static final boolean timeWarpEnabled = SystemPropertyUtil.getBoolean("tests.timewarp", true);