mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
Remove (again) test uses of onModule (#21414)
This change was reverted after it caused random test failures. This was due to a copy/paste error in the original PR which caused the mock version of ClusterInfoService to be used whenever the mock *ZenPing* was used, and the real ClusterInfoService to be used when MockZenPing was not used.
This commit is contained in:
parent
7ed195fe93
commit
48bfb142b9
12 changed files with 120 additions and 86 deletions
|
@ -20,17 +20,11 @@ If you squashed the whole thing into one class it'd look like:
|
|||
|
||||
[source,java]
|
||||
--------------------------------------------------
|
||||
public class MyNativeScriptPlugin extends Plugin {
|
||||
public class MyNativeScriptPlugin extends Plugin implements ScriptPlugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "my-native-script";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "my native script that does something great";
|
||||
}
|
||||
public void onModule(ScriptModule scriptModule) {
|
||||
scriptModule.registerScript("my_script", MyNativeScriptFactory.class);
|
||||
public List<NativeScriptFactory> getNativeScripts() {
|
||||
return Collections.singletonList(new MyNativeScriptFactory());
|
||||
}
|
||||
|
||||
public static class MyNativeScriptFactory implements NativeScriptFactory {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue