update mock script engines to take name parameter

Original commit: elastic/x-pack-elasticsearch@c6c48eca39
This commit is contained in:
Robert Muir 2016-05-13 15:42:23 -04:00
parent 0beefb5299
commit 91426062c1
2 changed files with 4 additions and 5 deletions

View File

@ -46,12 +46,11 @@ public class MockMustacheScriptEngine extends MockScriptEngine {
}
@Override
public Object compile(String script, Map<String, String> params) {
public Object compile(String name, String script, Map<String, String> params) {
if (script.contains("{{") && script.contains("}}")) {
throw new IllegalArgumentException("Fix your test to not rely on mustache");
}
return script;
return super.compile(name, script, params);
}
}

View File

@ -55,8 +55,8 @@ public class SleepScriptEngine implements ScriptEngineService {
}
@Override
public Object compile(String script, Map<String, String> params) {
return script;
public Object compile(String scriptName, String scriptSource, Map<String, String> params) {
return scriptSource;
}
@Override