Search in sources :

Example 1 with MustacheScriptEngineService

use of org.elasticsearch.script.mustache.MustacheScriptEngineService in project elasticsearch by elastic.

the class AbstractScriptTestCase method init.

@Before
public void init() throws Exception {
    Settings settings = Settings.builder().put("path.home", createTempDir()).put(ScriptService.SCRIPT_AUTO_RELOAD_ENABLED_SETTING.getKey(), false).build();
    ScriptEngineRegistry scriptEngineRegistry = new ScriptEngineRegistry(Arrays.asList(new MustacheScriptEngineService()));
    ScriptContextRegistry scriptContextRegistry = new ScriptContextRegistry(Collections.emptyList());
    ScriptSettings scriptSettings = new ScriptSettings(scriptEngineRegistry, scriptContextRegistry);
    ScriptService scriptService = new ScriptService(settings, new Environment(settings), null, scriptEngineRegistry, scriptContextRegistry, scriptSettings);
    templateService = new InternalTemplateService(scriptService);
}
Also used : ScriptService(org.elasticsearch.script.ScriptService) ScriptSettings(org.elasticsearch.script.ScriptSettings) ScriptEngineRegistry(org.elasticsearch.script.ScriptEngineRegistry) Environment(org.elasticsearch.env.Environment) Settings(org.elasticsearch.common.settings.Settings) ScriptSettings(org.elasticsearch.script.ScriptSettings) MustacheScriptEngineService(org.elasticsearch.script.mustache.MustacheScriptEngineService) ScriptContextRegistry(org.elasticsearch.script.ScriptContextRegistry) Before(org.junit.Before)

Aggregations

Settings (org.elasticsearch.common.settings.Settings)1 Environment (org.elasticsearch.env.Environment)1 ScriptContextRegistry (org.elasticsearch.script.ScriptContextRegistry)1 ScriptEngineRegistry (org.elasticsearch.script.ScriptEngineRegistry)1 ScriptService (org.elasticsearch.script.ScriptService)1 ScriptSettings (org.elasticsearch.script.ScriptSettings)1 MustacheScriptEngineService (org.elasticsearch.script.mustache.MustacheScriptEngineService)1 Before (org.junit.Before)1