Search in sources :

Example 1 with MockCompiledScript

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());
}
Also used : MockCompiledScript(org.elasticsearch.script.MockScriptEngine.MockCompiledScript) MockCompiledScript(org.elasticsearch.script.MockScriptEngine.MockCompiledScript) MockCompiledScript(org.elasticsearch.script.MockScriptEngine.MockCompiledScript) Settings(org.elasticsearch.common.settings.Settings)

Aggregations

Settings (org.elasticsearch.common.settings.Settings)1 MockCompiledScript (org.elasticsearch.script.MockScriptEngine.MockCompiledScript)1