From fd6cf7d3d3d021e4a5dd3df8a250f1367660bbe8 Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Tue, 10 May 2016 12:10:12 -0600 Subject: [PATCH] Register engines with a default of `ScriptMode.ON` Original commit: elastic/x-pack-elasticsearch@d367b4028e0f5a30b5158740b62a6a21c365ec13 --- .../org/elasticsearch/script/MockMustacheScriptEngine.java | 3 ++- .../test/java/org/elasticsearch/script/SleepScriptEngine.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/script/MockMustacheScriptEngine.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/script/MockMustacheScriptEngine.java index c0d1c7bce39..17db57da230 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/script/MockMustacheScriptEngine.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/script/MockMustacheScriptEngine.java @@ -5,6 +5,7 @@ */ package org.elasticsearch.script; +import org.elasticsearch.script.ScriptMode; import org.elasticsearch.xpack.common.text.DefaultTextTemplateEngine; import java.util.Collections; @@ -29,7 +30,7 @@ public class MockMustacheScriptEngine extends MockScriptEngine { public void onModule(ScriptModule module) { module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(MockMustacheScriptEngine.class, - Collections.singletonList(NAME))); + Collections.singletonList(NAME), ScriptMode.ON)); } } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/script/SleepScriptEngine.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/script/SleepScriptEngine.java index e8764f2ec98..dadaee3024d 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/script/SleepScriptEngine.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/script/SleepScriptEngine.java @@ -7,6 +7,7 @@ package org.elasticsearch.script; import org.elasticsearch.common.Nullable; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.script.ScriptMode; import org.elasticsearch.search.lookup.SearchLookup; import java.io.IOException; @@ -39,7 +40,7 @@ public class SleepScriptEngine implements ScriptEngineService { } public void onModule(ScriptModule module) { - module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(SleepScriptEngine.class, SleepScriptEngine.TYPES)); + module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(SleepScriptEngine.class, SleepScriptEngine.TYPES, ScriptMode.ON)); } }