diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java index 050bdd0066032..b0348061cf34d 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java @@ -210,7 +210,7 @@ static DeprecationIssue checkClusterRoutingAllocationIncludeRelocationsSetting(f } @SuppressWarnings("unchecked") - private static String getDetailsMessageForComponentTemplates(Map componentTemplates) { + private static String getDetailsMessageForGeoShapeComponentTemplates(Map componentTemplates) { String detailsForComponentTemplates = componentTemplates.entrySet().stream().map((templateCursor) -> { String templateName = templateCursor.getKey(); @@ -238,7 +238,7 @@ private static String getDetailsMessageForComponentTemplates(Map indexTemplates) { + private static String getDetailsMessageForGeoShapeIndexTemplates(ImmutableOpenMap indexTemplates) { String detailsForIndexTemplates = StreamSupport.stream(indexTemplates.spliterator(), false).map((templateCursor) -> { String templateName = templateCursor.key; @@ -268,8 +268,9 @@ private static String getDetailsMessageForIndexTemplates(ImmutableOpenMap value = (Map) entry.getValue(); return LegacyGeoShapeFieldMapper.DEPRECATED_PARAMETERS.stream() .filter(deprecatedParameter -> value.containsKey(deprecatedParameter)) - .map(deprecatedParameter -> String.format(Locale.ROOT, "parameter [%s] in field [%s]", type, deprecatedParameter, fieldName)) + .map(deprecatedParameter -> String.format(Locale.ROOT, "parameter [%s] in field [%s]", deprecatedParameter, fieldName)) .collect(Collectors.joining("; ")); } diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java index bbb6c384c2793..0deb011c90e3c 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java @@ -395,8 +395,8 @@ public void testCheckGeoShapeMappings() throws Exception { new DeprecationIssue(DeprecationIssue.Level.CRITICAL, "index templates contain deprecated geo_shape properties that must be removed", "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_mappings_changes", - "mappings in index template single-type contains deprecated geo_shape properties. [parameter [geo_shape] in field " + - "[points_only]; parameter [geo_shape] in field [strategy]]", false, null) + "mappings in index template single-type contains deprecated geo_shape properties. [parameter [points_only] in field " + + "[location]; parameter [strategy] in field [location]]", false, null) )); // Second, testing only a component template: @@ -417,8 +417,8 @@ public void testCheckGeoShapeMappings() throws Exception { new DeprecationIssue(DeprecationIssue.Level.CRITICAL, "component templates contain deprecated geo_shape properties that must be removed", "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_mappings_changes", - "mappings in component template my-template contains deprecated geo_shape properties. [parameter [geo_shape] in field " + - "[points_only]; parameter [geo_shape] in field [strategy]]", false, null) + "mappings in component template my-template contains deprecated geo_shape properties. [parameter [points_only] in field " + + "[location]; parameter [strategy] in field [location]]", false, null) )); // Third, trying a component template and an index template: @@ -433,10 +433,10 @@ public void testCheckGeoShapeMappings() throws Exception { new DeprecationIssue(DeprecationIssue.Level.CRITICAL, "component templates and index templates contain deprecated geo_shape properties that must be removed", "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_mappings_changes", - "mappings in component template my-template contains deprecated geo_shape properties. [parameter [geo_shape] in field " + - "[points_only]; parameter [geo_shape] in field [strategy]]; mappings in index template single-type contains " + - "deprecated geo_shape properties. [parameter [geo_shape] in field [points_only]; parameter [geo_shape] in field " + - "[strategy]]", false, null) + "mappings in component template my-template contains deprecated geo_shape properties. [parameter [points_only] in field " + + "[location]; parameter [strategy] in field [location]]; mappings in index template single-type contains " + + "deprecated geo_shape properties. [parameter [points_only] in field [location]; parameter [strategy] in field " + + "[location]]", false, null) )); } } diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java index 1f91bc8a866cf..89f13f500cfcc 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecksTests.java @@ -608,8 +608,8 @@ public void testCheckGeoShapeMappings() throws Exception { new DeprecationIssue(DeprecationIssue.Level.CRITICAL, "mappings for index test contains deprecated geo_shape properties that must be removed", "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_mappings_changes", - "The following geo_shape parameters must be removed from test: [[parameter [geo_shape] in field [points_only]; parameter " + - "[geo_shape] in field [strategy]]]", false, null) + "The following geo_shape parameters must be removed from test: [[parameter [points_only] in field [location]; parameter " + + "[strategy] in field [location]]]", false, null) )); Map nestedProperties = Stream.of(new Object[][] { @@ -627,8 +627,8 @@ public void testCheckGeoShapeMappings() throws Exception { new DeprecationIssue(DeprecationIssue.Level.CRITICAL, "mappings for index test contains deprecated geo_shape properties that must be removed", "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_mappings_changes", - "The following geo_shape parameters must be removed from test: [[parameter [geo_shape] in field [points_only]; parameter " + - "[geo_shape] in field [strategy]]]", false, null) + "The following geo_shape parameters must be removed from test: [[parameter [points_only] in field [location]; parameter " + + "[strategy] in field [location]]]", false, null) )); } }