MockScriptEngine and associated plugin has changed in ES core

Original commit: elastic/x-pack-elasticsearch@bb31b7b7c9
This commit is contained in:
Tanguy Leroux 2016-07-06 12:53:27 +02:00
parent 2c31e343b0
commit f861bb1661
1 changed files with 8 additions and 1 deletions

View File

@ -8,7 +8,9 @@ package org.elasticsearch.script;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.xpack.common.text.DefaultTextTemplateEngine;
import java.util.Collections;
import java.util.Map;
import java.util.function.Function;
/**
* A mock script engine that registers itself under the 'mustache' name so that
@ -19,11 +21,16 @@ public class MockMustacheScriptEngine extends MockScriptEngine {
public static final String NAME = "mustache";
public static class TestPlugin extends MockScriptEngine.TestPlugin {
public static class TestPlugin extends MockScriptPlugin {
@Override
public ScriptEngineService getScriptEngineService(Settings settings) {
return new MockMustacheScriptEngine();
}
@Override
protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
return Collections.emptyMap();
}
}
@Override