@@ -52,23 +52,23 @@ public void testGetSchemaVersionWithWrongSchemaVersion() {
5252 }
5353
5454 public void testShouldUpdateIndexWithoutOriginalVersion () throws IOException {
55- String indexContent = "{\" testIndex\" :{\" settings\" :{\" index\" :{\" creation_date\" :\" 1558407515699\" ," +
56- "\" number_of_shards\" :\" 1\" ,\" number_of_replicas\" :\" 1\" ,\" uuid\" :\" t-VBBW6aR6KpJ3XP5iISOA\" ," +
57- "\" version\" :{\" created\" :\" 6040399 \" },\" provided_name\" :\" data_test\" }},\" mapping_version\" :123," +
58- "\" settings_version\" :123,\" mappings\" :{\" _doc\" :{\" properties\" :{\" name\" :{\" type\" :\" keyword\" }}}}}}" ;
55+ String indexContent = "{\" testIndex\" :{\" settings\" :{\" index\" :{\" creation_date\" :\" 1558407515699\" ," +
56+ "\" number_of_shards\" :\" 1\" ,\" number_of_replicas\" :\" 1\" ,\" uuid\" :\" t-VBBW6aR6KpJ3XP5iISOA\" ," +
57+ "\" version\" :{\" created\" :\" 136217927 \" },\" provided_name\" :\" data_test\" }},\" mapping_version\" :123," +
58+ "\" settings_version\" :123, \" aliases_version \" :1 ,\" mappings\" :{\" _doc\" :{\" properties\" :{\" name\" :{\" type\" :\" keyword\" }}}}}}" ;
5959
60- String newMapping = "{\" _meta\" :{\" schema_version\" :10},\" properties\" :{\" name\" :{\" type\" :\" keyword\" }}}" ;
61- IndexMetadata index = IndexMetadata .fromXContent (parser (indexContent ));
62- boolean shouldUpdateIndex = IndexUtils .shouldUpdateIndex (index , newMapping );
60+ String newMapping = "{\" _meta\" :{\" schema_version\" :10},\" properties\" :{\" name\" :{\" type\" :\" keyword\" }}}" ;
61+ IndexMetadata index = IndexMetadata .fromXContent (parser (indexContent ));
62+ boolean shouldUpdateIndex = IndexUtils .shouldUpdateIndex (index , newMapping );
6363
64- Assert .assertTrue (shouldUpdateIndex );
64+ Assert .assertTrue (shouldUpdateIndex );
6565 }
6666
6767 public void testShouldUpdateIndexWithLaggedVersion () throws IOException {
6868 String indexContent = "{\" testIndex\" :{\" settings\" :{\" index\" :{\" creation_date\" :\" 1558407515699\" ," +
6969 "\" number_of_shards\" :\" 1\" ,\" number_of_replicas\" :\" 1\" ,\" uuid\" :\" t-VBBW6aR6KpJ3XP5iISOA\" ," +
70- "\" version\" :{\" created\" :\" 6040399 \" },\" provided_name\" :\" data_test\" }},\" mapping_version\" :123," +
71- "\" settings_version\" :123,\" mappings\" :{\" _doc\" :{\" _meta\" :{\" schema_version\" :1},\" properties\" :" +
70+ "\" version\" :{\" created\" :\" 136217927 \" },\" provided_name\" :\" data_test\" }},\" mapping_version\" :123," +
71+ "\" settings_version\" :123,\" aliases_version \" :1, \" mappings\" :{\" _doc\" :{\" _meta\" :{\" schema_version\" :1},\" properties\" :" +
7272 "{\" name\" :{\" type\" :\" keyword\" }}}}}}" ;
7373
7474 String newMapping = "{\" _meta\" :{\" schema_version\" :10},\" properties\" :{\" name\" :{\" type\" :\" keyword\" }}}" ;
@@ -81,7 +81,7 @@ public void testShouldUpdateIndexWithLaggedVersion() throws IOException {
8181 public void testShouldUpdateIndexWithSameVersion () throws IOException {
8282 String indexContent = "{\" testIndex\" :{\" settings\" :{\" index\" :{\" creation_date\" :\" 1558407515699\" ," +
8383 "\" number_of_shards\" :\" 1\" ,\" number_of_replicas\" :\" 1\" ,\" uuid\" :\" t-VBBW6aR6KpJ3XP5iISOA\" ," +
84- "\" version\" :{\" created\" :\" 6040399 \" },\" provided_name\" :\" data_test\" }},\" mapping_version\" :\" 1\" ," +
84+ "\" version\" :{\" created\" :\" 136217927 \" },\" provided_name\" :\" data_test\" }},\" mapping_version\" :\" 1\" ," +
8585 "\" settings_version\" :\" 1\" ,\" aliases_version\" :\" 1\" ,\" mappings\" :" +
8686 "{\" _doc\" :{\" _meta\" :{\" schema_version\" :1},\" properties\" :{\" name\" :{\" type\" :\" keyword\" }}}}}}" ;
8787
0 commit comments