@@ -120,6 +120,10 @@ public void testMatchTemplates() throws Exception {
120
120
121
121
final ClusterState result = executeTask ();
122
122
123
+ assertWarnings ("the default number of shards will change from [5] to [1] in 7.0.0; "
124
+ + "if you wish to continue using the default of [5] shards, "
125
+ + "you must manage this on the create index request or with an index template" );
126
+
123
127
assertThat (result .metaData ().index ("test" ).getAliases (), hasAllKeys ("alias_from_template_1" , "alias_from_template_2" ));
124
128
assertThat (result .metaData ().index ("test" ).getAliases (), not (hasKey ("alias_from_template_3" )));
125
129
}
@@ -134,6 +138,10 @@ public void testApplyDataFromTemplate() throws Exception {
134
138
135
139
final ClusterState result = executeTask ();
136
140
141
+ assertWarnings ("the default number of shards will change from [5] to [1] in 7.0.0; "
142
+ + "if you wish to continue using the default of [5] shards, "
143
+ + "you must manage this on the create index request or with an index template" );
144
+
137
145
assertThat (result .metaData ().index ("test" ).getAliases (), hasKey ("alias1" ));
138
146
assertThat (result .metaData ().index ("test" ).getCustoms (), hasKey ("custom1" ));
139
147
assertThat (result .metaData ().index ("test" ).getSettings ().get ("key1" ), equalTo ("value1" ));
@@ -148,6 +156,10 @@ public void testApplyDataFromRequest() throws Exception {
148
156
149
157
final ClusterState result = executeTask ();
150
158
159
+ assertWarnings ("the default number of shards will change from [5] to [1] in 7.0.0; "
160
+ + "if you wish to continue using the default of [5] shards, "
161
+ + "you must manage this on the create index request or with an index template" );
162
+
151
163
assertThat (result .metaData ().index ("test" ).getAliases (), hasKey ("alias1" ));
152
164
assertThat (result .metaData ().index ("test" ).getCustoms (), hasKey ("custom1" ));
153
165
assertThat (result .metaData ().index ("test" ).getSettings ().get ("key1" ), equalTo ("value1" ));
@@ -177,6 +189,10 @@ public void testRequestDataHavePriorityOverTemplateData() throws Exception {
177
189
178
190
final ClusterState result = executeTask ();
179
191
192
+ assertWarnings ("the default number of shards will change from [5] to [1] in 7.0.0; "
193
+ + "if you wish to continue using the default of [5] shards, "
194
+ + "you must manage this on the create index request or with an index template" );
195
+
180
196
assertThat (result .metaData ().index ("test" ).getCustoms ().get ("custom1" ), equalTo (mergedCustom ));
181
197
assertThat (result .metaData ().index ("test" ).getAliases ().get ("alias1" ).getSearchRouting (), equalTo ("fromReq" ));
182
198
assertThat (result .metaData ().index ("test" ).getSettings ().get ("key1" ), equalTo ("reqValue" ));
@@ -186,6 +202,10 @@ public void testRequestDataHavePriorityOverTemplateData() throws Exception {
186
202
public void testDefaultSettings () throws Exception {
187
203
final ClusterState result = executeTask ();
188
204
205
+ assertWarnings ("the default number of shards will change from [5] to [1] in 7.0.0; "
206
+ + "if you wish to continue using the default of [5] shards, "
207
+ + "you must manage this on the create index request or with an index template" );
208
+
189
209
assertThat (result .getMetaData ().index ("test" ).getSettings ().get (SETTING_NUMBER_OF_SHARDS ), equalTo ("5" ));
190
210
}
191
211
@@ -194,6 +214,10 @@ public void testSettingsFromClusterState() throws Exception {
194
214
195
215
final ClusterState result = executeTask ();
196
216
217
+ assertWarnings ("the default number of shards will change from [5] to [1] in 7.0.0; "
218
+ + "if you wish to continue using the default of [5] shards, "
219
+ + "you must manage this on the create index request or with an index template" );
220
+
197
221
assertThat (result .getMetaData ().index ("test" ).getSettings ().get (SETTING_NUMBER_OF_SHARDS ), equalTo ("15" ));
198
222
}
199
223
@@ -246,6 +270,10 @@ public void testRequestStateOpen() throws Exception {
246
270
247
271
executeTask ();
248
272
273
+ assertWarnings ("the default number of shards will change from [5] to [1] in 7.0.0; "
274
+ + "if you wish to continue using the default of [5] shards, "
275
+ + "you must manage this on the create index request or with an index template" );
276
+
249
277
verify (allocationService , times (1 )).reroute (anyObject (), anyObject ());
250
278
}
251
279
@@ -255,6 +283,10 @@ public void testIndexRemovalOnFailure() throws Exception {
255
283
256
284
expectThrows (RuntimeException .class , this ::executeTask );
257
285
286
+ assertWarnings ("the default number of shards will change from [5] to [1] in 7.0.0; "
287
+ + "if you wish to continue using the default of [5] shards, "
288
+ + "you must manage this on the create index request or with an index template" );
289
+
258
290
verify (indicesService , times (1 )).removeIndex (anyObject (), anyObject (), anyObject ());
259
291
}
260
292
@@ -290,6 +322,10 @@ public void testValidateWaitForActiveShardsFailure() throws Exception {
290
322
291
323
IllegalArgumentException e = expectThrows (IllegalArgumentException .class , this ::executeTask );
292
324
325
+ assertWarnings ("the default number of shards will change from [5] to [1] in 7.0.0; "
326
+ + "if you wish to continue using the default of [5] shards, "
327
+ + "you must manage this on the create index request or with an index template" );
328
+
293
329
assertThat (e .getMessage (), containsString ("invalid wait_for_active_shards" ));
294
330
}
295
331
0 commit comments