use of org.elasticsearch.script.MockScriptEngine.MockCompiledScript in project elasticsearch by elastic.
the class FileScriptTests method testFileScriptFound.
public void testFileScriptFound() throws Exception {
Settings settings = Settings.builder().put("script.engine." + MockScriptEngine.NAME + ".file.aggs", "false").build();
ScriptService scriptService = makeScriptService(settings);
Script script = new Script(ScriptType.FILE, MockScriptEngine.NAME, "script1", Collections.emptyMap());
CompiledScript compiledScript = scriptService.compile(script, ScriptContext.Standard.SEARCH);
assertNotNull(compiledScript);
MockCompiledScript executable = (MockCompiledScript) compiledScript.compiled();
assertEquals("script1.mockscript", executable.getName());
}
Aggregations