Register index.version.created in Kuromoji unittest since it's a node level setting here
This commit is contained in:
parent
c2e8ba8970
commit
20fe8ac854
|
@ -38,6 +38,7 @@ import org.elasticsearch.indices.analysis.AnalysisModule;
|
||||||
import org.elasticsearch.plugin.analysis.kuromoji.AnalysisKuromojiPlugin;
|
import org.elasticsearch.plugin.analysis.kuromoji.AnalysisKuromojiPlugin;
|
||||||
import org.elasticsearch.test.ESTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.test.IndexSettingsModule;
|
import org.elasticsearch.test.IndexSettingsModule;
|
||||||
|
import org.elasticsearch.test.InternalSettingsPlugin;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -202,12 +203,13 @@ public class KuromojiAnalysisTests extends ESTestCase {
|
||||||
.loadFromStream(json, getClass().getResourceAsStream(json))
|
.loadFromStream(json, getClass().getResourceAsStream(json))
|
||||||
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
|
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
|
||||||
.build();
|
.build();
|
||||||
|
final SettingsModule settingsModule = new SettingsModule(settings, new SettingsFilter(settings));
|
||||||
|
settingsModule.registerSetting(InternalSettingsPlugin.VERSION_CREATED);
|
||||||
Index index = new Index("test");
|
Index index = new Index("test");
|
||||||
|
|
||||||
AnalysisModule analysisModule = new AnalysisModule(new Environment(settings));
|
AnalysisModule analysisModule = new AnalysisModule(new Environment(settings));
|
||||||
new AnalysisKuromojiPlugin().onModule(analysisModule);
|
new AnalysisKuromojiPlugin().onModule(analysisModule);
|
||||||
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings, new SettingsFilter(settings)),
|
Injector parentInjector = new ModulesBuilder().add(settingsModule,
|
||||||
new EnvironmentModule(new Environment(settings)), analysisModule)
|
new EnvironmentModule(new Environment(settings)), analysisModule)
|
||||||
.createInjector();
|
.createInjector();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue