From 3b58334efb459af1e34ba2bfce4d2eb483ab1d7b Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 24 May 2017 19:20:59 -0700 Subject: [PATCH] Refactor script context generic types (elastic/x-pack-elasticsearch#1547) This is the xpack side of https://github.com/elastic/elasticsearch/pull/24877 Original commit: elastic/x-pack-elasticsearch@4f3a1a27e6640ac7ec2bd593140a7d063a87ac95 --- .../java/org/elasticsearch/xpack/watcher/Watcher.java | 8 ++++---- .../org/elasticsearch/smoketest/WatcherTemplateIT.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java b/plugin/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java index b9fd59ecef5..59f470d71a3 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java @@ -182,11 +182,11 @@ public class Watcher implements ActionPlugin { public static final Setting MAX_STOP_TIMEOUT_SETTING = Setting.timeSetting("xpack.watcher.stop.timeout", TimeValue.timeValueSeconds(30), Setting.Property.NodeScope); - public static final ScriptContext SCRIPT_SEARCH_CONTEXT = - new ScriptContext<>("xpack", SearchScript.class, SearchScript.Compiled.class); + public static final ScriptContext SCRIPT_SEARCH_CONTEXT = + new ScriptContext<>("xpack", SearchScript.Compiled.class); // TODO: remove this context when each xpack script use case has their own contexts - public static final ScriptContext SCRIPT_EXECUTABLE_CONTEXT - = new ScriptContext<>("xpack_executable", ExecutableScript.class, ExecutableScript.Compiled.class); + public static final ScriptContext SCRIPT_EXECUTABLE_CONTEXT + = new ScriptContext<>("xpack_executable", ExecutableScript.Compiled.class); private static final Logger logger = Loggers.getLogger(Watcher.class); private WatcherIndexingListener listener; diff --git a/qa/smoke-test-watcher-with-mustache/src/test/java/org/elasticsearch/smoketest/WatcherTemplateIT.java b/qa/smoke-test-watcher-with-mustache/src/test/java/org/elasticsearch/smoketest/WatcherTemplateIT.java index 1d68bbfd3f1..91ba78930e0 100644 --- a/qa/smoke-test-watcher-with-mustache/src/test/java/org/elasticsearch/smoketest/WatcherTemplateIT.java +++ b/qa/smoke-test-watcher-with-mustache/src/test/java/org/elasticsearch/smoketest/WatcherTemplateIT.java @@ -39,7 +39,7 @@ public class WatcherTemplateIT extends ESTestCase { public void init() throws Exception { MustacheScriptEngine engine = new MustacheScriptEngine(); Map engines = Collections.singletonMap(engine.getType(), engine); - Map> contexts = + Map> contexts = Collections.singletonMap(Watcher.SCRIPT_EXECUTABLE_CONTEXT.name, Watcher.SCRIPT_EXECUTABLE_CONTEXT); ScriptService scriptService = new ScriptService(Settings.EMPTY, engines, contexts); textTemplateEngine = new TextTemplateEngine(Settings.EMPTY, scriptService);