diff --git a/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v1/PageImpl.java b/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v1/PageImpl.java index 42ba004eeb..f090eb1f05 100644 --- a/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v1/PageImpl.java +++ b/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v1/PageImpl.java @@ -19,6 +19,7 @@ import java.util.Arrays; import java.util.Calendar; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; @@ -149,6 +150,7 @@ protected void initModel() { private String[] buildKeywords() { Tag[] tags = currentPage.getTags(); + Arrays.sort(tags, Comparator.comparing(Tag::getName)); String[] keywords = new String[tags.length]; int index = 0; Locale language= currentPage.getLanguage(false); diff --git a/bundles/core/src/test/resources/page/exporter-templated-page.json b/bundles/core/src/test/resources/page/exporter-templated-page.json index 7cbf2db3ab..6492e7b099 100644 --- a/bundles/core/src/test/resources/page/exporter-templated-page.json +++ b/bundles/core/src/test/resources/page/exporter-templated-page.json @@ -18,8 +18,8 @@ "xdm:template": "/conf/coretest/settings/wcm/templates/product-page", "repo:path": "/core/content/page/templated-page.html", "xdm:tags": [ - "three", "one", + "three", "two" ] } diff --git a/bundles/core/src/test/resources/page/v2/exporter-templated-page.json b/bundles/core/src/test/resources/page/v2/exporter-templated-page.json index 0e35574280..5be10be4a2 100644 --- a/bundles/core/src/test/resources/page/v2/exporter-templated-page.json +++ b/bundles/core/src/test/resources/page/v2/exporter-templated-page.json @@ -72,8 +72,8 @@ "xdm:template": "/conf/coretest/settings/wcm/templates/product-page", "xdm:language": "en-GB", "xdm:tags": [ - "three", "one", + "three", "two" ], "repo:path": "/core/content/page/templated-page.html" diff --git a/bundles/core/src/test/resources/page/v3/exporter-templated-page.json b/bundles/core/src/test/resources/page/v3/exporter-templated-page.json index 262a81834d..b732f11198 100644 --- a/bundles/core/src/test/resources/page/v3/exporter-templated-page.json +++ b/bundles/core/src/test/resources/page/v3/exporter-templated-page.json @@ -72,8 +72,8 @@ "xdm:template": "/conf/coretest/settings/wcm/templates/product-page", "xdm:language": "en-GB", "xdm:tags": [ - "three", "one", + "three", "two" ], "repo:path": "/core/content/page/templated-page.html"