[TEST] Make MockMustacheScriptEngine less strict

Since elastic/elasticsearch#19621 MockScriptEngine is stricter and expects scripts to be defined before being used in tests. Because watcher makes heavy use of scripts without really need of custom logic, this commit changed the MockMustacheScriptEngine implementation so that it always returns the script's source as a result.

Original commit: elastic/x-pack-elasticsearch@09cffa9517
This commit is contained in:
Tanguy Leroux 2016-08-01 18:13:43 +02:00
parent 2297c493e4
commit 62d3c19db5
1 changed files with 2 additions and 2 deletions

View File

@ -48,8 +48,8 @@ public class MockMustacheScriptEngine extends MockScriptEngine {
if (script.contains("{{") && script.contains("}}")) {
throw new IllegalArgumentException("Fix your test to not rely on mustache");
}
return super.compile(name, script, params);
// We always return the script's source as it is
return new MockCompiledScript(name, params, script, null);
}
@Override