Fix scripting engines for singular type
Original commit: elastic/x-pack-elasticsearch@ed014cefc3
This commit is contained in:
parent
fd6cf7d3d3
commit
91f2e94ac7
|
@ -42,7 +42,7 @@ public final class MessyTestUtils {
|
|||
engineServiceSet.add(groovyScriptEngineService);
|
||||
ScriptEngineRegistry scriptEngineRegistry = new ScriptEngineRegistry(
|
||||
Arrays.asList(
|
||||
new ScriptEngineRegistry.ScriptEngineRegistration(GroovyScriptEngineService.class, GroovyScriptEngineService.TYPES)
|
||||
new ScriptEngineRegistry.ScriptEngineRegistration(GroovyScriptEngineService.class, GroovyScriptEngineService.NAME)
|
||||
)
|
||||
);
|
||||
ScriptContextRegistry scriptContextRegistry = new ScriptContextRegistry(Arrays.asList(ScriptServiceProxy.INSTANCE));
|
||||
|
|
|
@ -56,7 +56,7 @@ public class WatcherTemplateTests extends ESTestCase {
|
|||
ScriptEngineRegistry scriptEngineRegistry = new ScriptEngineRegistry(
|
||||
Arrays.asList(
|
||||
new ScriptEngineRegistry.ScriptEngineRegistration(MustacheScriptEngineService.class,
|
||||
MustacheScriptEngineService.TYPES)
|
||||
MustacheScriptEngineService.NAME)
|
||||
)
|
||||
);
|
||||
ScriptSettings scriptSettings = new ScriptSettings(scriptEngineRegistry, registry);
|
||||
|
|
|
@ -30,19 +30,19 @@ public class MockMustacheScriptEngine extends MockScriptEngine {
|
|||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(MockMustacheScriptEngine.class,
|
||||
Collections.singletonList(NAME), ScriptMode.ON));
|
||||
NAME, ScriptMode.ON));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTypes() {
|
||||
return Collections.singletonList(NAME);
|
||||
public String getType() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getExtensions() {
|
||||
return getTypes();
|
||||
return Collections.singletonList(NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -40,14 +40,15 @@ public class SleepScriptEngine implements ScriptEngineService {
|
|||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(SleepScriptEngine.class, SleepScriptEngine.TYPES, ScriptMode.ON));
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(SleepScriptEngine.class,
|
||||
SleepScriptEngine.NAME, ScriptMode.ON));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTypes() {
|
||||
return TYPES;
|
||||
public String getType() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue