21
21
22
22
import org .apache .lucene .analysis .Analyzer ;
23
23
import org .apache .lucene .analysis .pl .PolishAnalyzer ;
24
+ import org .elasticsearch .Version ;
25
+ import org .elasticsearch .cluster .metadata .IndexMetaData ;
24
26
import org .elasticsearch .common .inject .Injector ;
25
27
import org .elasticsearch .common .inject .ModulesBuilder ;
28
+ import org .elasticsearch .common .settings .Settings ;
26
29
import org .elasticsearch .common .settings .SettingsModule ;
27
30
import org .elasticsearch .env .Environment ;
28
31
import org .elasticsearch .env .EnvironmentModule ;
38
41
import org .junit .Test ;
39
42
40
43
import static org .elasticsearch .common .settings .ImmutableSettings .Builder .EMPTY_SETTINGS ;
44
+ import static org .elasticsearch .common .settings .ImmutableSettings .settingsBuilder ;
41
45
import static org .hamcrest .Matchers .instanceOf ;
42
46
43
47
/**
@@ -47,10 +51,13 @@ public class PolishAnalysisTests extends ElasticsearchTestCase {
47
51
@ Test
48
52
public void testDefaultsPolishAnalysis () {
49
53
Index index = new Index ("test" );
54
+ Settings settings = settingsBuilder ()
55
+ .put (IndexMetaData .SETTING_VERSION_CREATED , Version .CURRENT )
56
+ .build ();
50
57
51
58
Injector parentInjector = new ModulesBuilder ().add (new SettingsModule (EMPTY_SETTINGS ), new EnvironmentModule (new Environment (EMPTY_SETTINGS )), new IndicesAnalysisModule ()).createInjector ();
52
59
Injector injector = new ModulesBuilder ().add (
53
- new IndexSettingsModule (index , EMPTY_SETTINGS ),
60
+ new IndexSettingsModule (index , settings ),
54
61
new IndexNameModule (index ),
55
62
new AnalysisModule (EMPTY_SETTINGS , parentInjector .getInstance (IndicesAnalysisService .class )).addProcessor (new PolishAnalysisBinderProcessor ()))
56
63
.createChildInjector (parentInjector );
0 commit comments