Skip to content

Commit 7d1bed2

Browse files
committed
Merge branch 'develop'
2 parents 6fd2dee + 3f59220 commit 7d1bed2

File tree

29 files changed

+104
-114
lines changed

29 files changed

+104
-114
lines changed

.github/workflows/maven-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ${{ matrix.os }}
2121
strategy:
2222
matrix:
23-
java: [8, 11, 17]
23+
java: [11, 17]
2424
os: [ubuntu-latest]
2525
distribution: [temurin]
2626

.github/workflows/maven-deploy.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Deploy snapshots to Sonatpe OSS repository and deploy site to GitHub Pages
1+
# Deploy snapshots to Sonatype OSS repository and deploy site to GitHub Pages
22

33
name: Deploy
44

@@ -15,19 +15,19 @@ jobs:
1515

1616
steps:
1717
- name: Checkout code
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
1919

2020
- name: Configure GIT
2121
run: |
2222
git config --global user.email "${{ secrets.GH_SITE_DEPLOY_EMAIL }}"
2323
git config --global user.name "${{ secrets.GH_SITE_DEPLOY_NAME }}"
2424
2525
- name: Setup JDK
26-
uses: actions/setup-java@v2
26+
uses: actions/setup-java@v3
2727
with:
2828
distribution: temurin
29-
java-version: 8
30-
cache: 'maven'
29+
java-version: 11
30+
cache: maven
3131

3232
- name: Build, verify, deploy, generate site
3333
env:

.github/workflows/release-from-tag.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
permissions:
1313
contents: write
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- uses: ncipollo/release-action@v1
1717
with:
1818
body: 'Changes: https://wcm.io/wcm/core-components/changes-report.html'

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<img src="https://wcm.io/images/[email protected]"/> wcm.io WCM Core Components
22
======
33
[![Build](https://github.com/wcm-io/io.wcm.wcm.core.components/workflows/Build/badge.svg?branch=develop)](https://github.com/wcm-io/io.wcm.wcm.core.components/actions?query=workflow%3ABuild+branch%3Adevelop)
4-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.wcm/io.wcm.wcm.core.components/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.wcm/io.wcm.wcm.core.components)
4+
[![Maven Central](https://img.shields.io/maven-central/v/io.wcm/io.wcm.wcm.core.components)](https://repo1.maven.org/maven2/io/wcm/io.wcm.wcm.core.components/)
55
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=wcm-io_io.wcm.wcm.core.components&metric=coverage)](https://sonarcloud.io/summary/new_code?id=wcm-io_io.wcm.wcm.core.components)
66

77
Enhances [AEM WCM Core Components][adobe-core-components] with wcm.io functionality.
88

99
Documentation: https://wcm.io/wcm/core-components/<br/>
10-
Issues: https://wcm-io.atlassian.net/browse/WWCM<br/>
10+
Issues: https://github.com/wcm-io/io.wcm.wcm.core.components/issues<br/>
1111
Wiki: https://wcm-io.atlassian.net/wiki/<br/>
1212
Continuous Integration: https://github.com/wcm-io/io.wcm.wcm.core.components/actions<br/>
1313
Commercial support: https://wcm.io/commercial-support.html

build-deploy_aem65.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fi
2626
# install AEM 6.5 with service pack
2727
mvn --non-recursive wcmio-content-package:install \
2828
--activate-profiles=${MAVEN_PROFILES} \
29-
-Dvault.artifact=adobe.binary.aem.65.servicepack:aem-service-pkg:zip:6.5.13.0 \
29+
-Dvault.artifact=adobe.binary.aem.65.servicepack:aem-service-pkg:zip:6.5.15.0 \
3030
-Dvault.delayAfterInstallSec=30
3131

3232
if [ "$?" -ne "0" ]; then

bundles/core/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<parent>
2626
<groupId>io.wcm</groupId>
2727
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
28-
<version>1.12.0-2.20.0</version>
28+
<version>1.12.2-2.21.2</version>
2929
<relativePath>../../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm</groupId>
3333
<artifactId>io.wcm.wcm.core.components</artifactId>
34-
<version>1.12.0-2.20.0</version>
34+
<version>1.12.2-2.21.2</version>
3535
<packaging>jar</packaging>
3636

3737
<name>WCM Core Components</name>

bundles/core/src/main/java/io/wcm/wcm/core/components/impl/link/LinkHtmlAttributesSerializer.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import com.fasterxml.jackson.core.JsonGenerator;
3030
import com.fasterxml.jackson.databind.SerializerProvider;
3131
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
32-
import com.google.common.collect.ImmutableSet;
3332

3433
/**
3534
* Serialized map of link attributes, omitting the "href" property.
@@ -40,7 +39,7 @@ public class LinkHtmlAttributesSerializer extends StdSerializer<Map<String, Stri
4039
/**
4140
* List of the link's ignored html attributes from the Json export.
4241
*/
43-
private static final Set<String> IGNORED_HTML_ATTRIBUTES = ImmutableSet.of("href");
42+
private static final Set<String> IGNORED_HTML_ATTRIBUTES = Set.of("href");
4443

4544
/**
4645
* Constructor.

bundles/core/src/test/java/io/wcm/wcm/core/components/impl/link/LinkWrapperTest.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@
3131
import static org.junit.jupiter.api.Assertions.assertNull;
3232
import static org.junit.jupiter.api.Assertions.assertTrue;
3333

34+
import java.util.Map;
35+
3436
import org.apache.sling.api.resource.Resource;
3537
import org.junit.jupiter.api.BeforeEach;
3638
import org.junit.jupiter.api.Test;
3739
import org.junit.jupiter.api.extension.ExtendWith;
3840

3941
import com.day.cq.dam.api.Asset;
4042
import com.day.cq.wcm.api.Page;
41-
import com.google.common.collect.ImmutableMap;
4243

4344
import ch.randelshofer.io.ByteArrayImageInputStream;
4445
import io.wcm.handler.link.LinkHandler;
@@ -89,7 +90,7 @@ void testPageLink() {
8990
assertEquals(url, underTest.getURL());
9091
assertEquals(url, underTest.getMappedURL());
9192
assertEquals(url, underTest.getExternalizedURL());
92-
assertEquals(ImmutableMap.of("href", url), underTest.getHtmlAttributes());
93+
assertEquals(Map.of("href", url), underTest.getHtmlAttributes());
9394
assertEquals(page, underTest.getReference());
9495
assertNotNull(underTest.getLinkObject());
9596

@@ -107,7 +108,7 @@ void testAssetLink() {
107108
assertEquals(url, underTest.getURL());
108109
assertEquals(url, underTest.getMappedURL());
109110
assertEquals(url, underTest.getExternalizedURL());
110-
assertEquals(ImmutableMap.of("href", url), underTest.getHtmlAttributes());
111+
assertEquals(Map.of("href", url), underTest.getHtmlAttributes());
111112
assertTrue(underTest.getReference() instanceof io.wcm.handler.media.Asset);
112113
assertEquals(asset.getPath(), ((io.wcm.handler.media.Asset)underTest.getReference()).getPath());
113114
assertNotNull(underTest.getLinkObject());
@@ -130,7 +131,7 @@ void testExternalLink() {
130131
assertEquals(url, underTest.getURL());
131132
assertEquals(url, underTest.getMappedURL());
132133
assertEquals(url, underTest.getExternalizedURL());
133-
assertEquals(ImmutableMap.of("href", url, "target", target), underTest.getHtmlAttributes());
134+
assertEquals(Map.of("href", url, "target", target), underTest.getHtmlAttributes());
134135
assertNull(underTest.getReference());
135136
assertNotNull(underTest.getLinkObject());
136137

bundles/core/src/test/java/io/wcm/wcm/core/components/impl/models/helpers/DataLayerTestUtils.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import com.adobe.cq.wcm.core.components.models.NavigationItem;
4040
import com.adobe.cq.wcm.core.components.models.datalayer.ComponentData;
4141
import com.day.cq.wcm.api.Page;
42-
import com.google.common.collect.ImmutableList;
4342

4443
import io.wcm.testing.mock.aem.junit5.AemContext;
4544

@@ -75,7 +74,6 @@ public static void assertNavigationItems_DataLayer(Collection<NavigationItem> it
7574
assertListItems_DataLayer((Collection)items, pages);
7675
}
7776

78-
@SuppressWarnings("null")
7977
public static void assertListItems_DataLayer(Collection<ListItem> items, Page... pages) {
8078
List<String> expected = Arrays.stream(pages)
8179
.map(Page::getPath)
@@ -85,7 +83,7 @@ public static void assertListItems_DataLayer(Collection<ListItem> items, Page...
8583
.collect(Collectors.toList());
8684
assertEquals(expected, actual);
8785

88-
List<ListItem> itemsList = ImmutableList.copyOf(items);
86+
List<ListItem> itemsList = List.copyOf(items);
8987
for (int i = 0; i < items.size(); i++) {
9088
Page page = pages[i];
9189
ListItem item = itemsList.get(i);

bundles/core/src/test/java/io/wcm/wcm/core/components/impl/models/helpers/LanguageNavigationItemV1ImplTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import static org.junit.jupiter.api.Assertions.assertEquals;
2626
import static org.junit.jupiter.api.Assertions.assertTrue;
2727

28+
import java.util.Collections;
2829
import java.util.Locale;
2930

3031
import org.junit.jupiter.api.BeforeEach;
@@ -33,7 +34,6 @@
3334

3435
import com.adobe.cq.wcm.core.components.models.LanguageNavigationItem;
3536
import com.day.cq.wcm.api.Page;
36-
import com.google.common.collect.ImmutableList;
3737

3838
import io.wcm.handler.link.Link;
3939
import io.wcm.handler.link.LinkHandler;
@@ -63,12 +63,12 @@ void testValidLink() {
6363
JCR_LANGUAGE, "fr_CA"));
6464
Link link = linkHandler.get(page).build();
6565
LanguageNavigationItem underTest = new LanguageNavigationItemV1Impl(page, link,
66-
5, true, true, ImmutableList.of(), "My Title", "p-id", null);
66+
5, true, true, Collections.emptyList(), "My Title", "p-id", null);
6767

6868
assertEquals(page.getPath(), underTest.getPage().getPath());
6969
assertTrue(underTest.isActive());
7070
assertTrue(underTest.isCurrent());
71-
assertEquals(ImmutableList.of(), underTest.getChildren());
71+
assertEquals(Collections.emptyList(), underTest.getChildren());
7272
assertEquals(5, underTest.getLevel());
7373

7474
assertEquals("My Title", underTest.getTitle());

bundles/core/src/test/java/io/wcm/wcm/core/components/impl/models/helpers/LanguageNavigationItemV2ImplTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import static org.junit.jupiter.api.Assertions.assertEquals;
2626
import static org.junit.jupiter.api.Assertions.assertTrue;
2727

28+
import java.util.Collections;
2829
import java.util.Locale;
2930

3031
import org.junit.jupiter.api.BeforeEach;
@@ -33,7 +34,6 @@
3334

3435
import com.adobe.cq.wcm.core.components.models.LanguageNavigationItem;
3536
import com.day.cq.wcm.api.Page;
36-
import com.google.common.collect.ImmutableList;
3737

3838
import io.wcm.handler.link.Link;
3939
import io.wcm.handler.link.LinkHandler;
@@ -63,12 +63,12 @@ void testValidLink() {
6363
JCR_LANGUAGE, "fr_CA"));
6464
Link link = linkHandler.get(page).build();
6565
LanguageNavigationItem underTest = new LanguageNavigationItemV2Impl(page, link,
66-
5, true, true, ImmutableList.of(), "My Title", "p-id", null);
66+
5, true, true, Collections.emptyList(), "My Title", "p-id", null);
6767

6868
assertEquals(page.getPath(), underTest.getPage().getPath());
6969
assertTrue(underTest.isActive());
7070
assertTrue(underTest.isCurrent());
71-
assertEquals(ImmutableList.of(), underTest.getChildren());
71+
assertEquals(Collections.emptyList(), underTest.getChildren());
7272
assertEquals(5, underTest.getLevel());
7373

7474
assertEquals("My Title", underTest.getTitle());

bundles/core/src/test/java/io/wcm/wcm/core/components/impl/models/helpers/NavigationItemV1ImplTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424
import static org.junit.jupiter.api.Assertions.assertEquals;
2525
import static org.junit.jupiter.api.Assertions.assertTrue;
2626

27+
import java.util.Collections;
28+
2729
import org.junit.jupiter.api.BeforeEach;
2830
import org.junit.jupiter.api.Test;
2931
import org.junit.jupiter.api.extension.ExtendWith;
3032

3133
import com.adobe.cq.wcm.core.components.models.NavigationItem;
3234
import com.day.cq.wcm.api.Page;
33-
import com.google.common.collect.ImmutableList;
3435

3536
import io.wcm.handler.link.Link;
3637
import io.wcm.handler.link.LinkHandler;
@@ -59,12 +60,12 @@ void testValidLink() {
5960
ImmutableValueMap.of(JCR_DESCRIPTION, "My Description"));
6061
Link link = linkHandler.get(page).build();
6162
NavigationItem underTest = new NavigationItemV1Impl(page, link,
62-
5, true, true, ImmutableList.of(), "p-id", null);
63+
5, true, true, Collections.emptyList(), "p-id", null);
6364

6465
assertEquals(page.getPath(), underTest.getPage().getPath());
6566
assertTrue(underTest.isActive());
6667
assertTrue(underTest.isCurrent());
67-
assertEquals(ImmutableList.of(), underTest.getChildren());
68+
assertEquals(Collections.emptyList(), underTest.getChildren());
6869
assertEquals(5, underTest.getLevel());
6970
}
7071

bundles/core/src/test/java/io/wcm/wcm/core/components/impl/models/helpers/NavigationItemV2ImplTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424
import static org.junit.jupiter.api.Assertions.assertEquals;
2525
import static org.junit.jupiter.api.Assertions.assertTrue;
2626

27+
import java.util.Collections;
28+
2729
import org.junit.jupiter.api.BeforeEach;
2830
import org.junit.jupiter.api.Test;
2931
import org.junit.jupiter.api.extension.ExtendWith;
3032

3133
import com.adobe.cq.wcm.core.components.models.NavigationItem;
3234
import com.day.cq.wcm.api.Page;
33-
import com.google.common.collect.ImmutableList;
3435

3536
import io.wcm.handler.link.Link;
3637
import io.wcm.handler.link.LinkHandler;
@@ -59,12 +60,12 @@ void testValidLink() {
5960
ImmutableValueMap.of(JCR_DESCRIPTION, "My Description"));
6061
Link link = linkHandler.get(page).build();
6162
NavigationItem underTest = new NavigationItemV2Impl(page, link,
62-
5, true, true, ImmutableList.of(), "p-id", null);
63+
5, true, true, Collections.emptyList(), "p-id", null);
6364

6465
assertEquals(page.getPath(), underTest.getPage().getPath());
6566
assertTrue(underTest.isActive());
6667
assertTrue(underTest.isCurrent());
67-
assertEquals(ImmutableList.of(), underTest.getChildren());
68+
assertEquals(Collections.emptyList(), underTest.getChildren());
6869
assertEquals(5, underTest.getLevel());
6970
}
7071

bundles/core/src/test/java/io/wcm/wcm/core/components/impl/models/v3/ListV3ImplTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import static org.junit.jupiter.api.Assertions.assertNotNull;
4141
import static org.junit.jupiter.api.Assertions.assertNull;
4242

43+
import java.util.ArrayList;
4344
import java.util.Collection;
4445

4546
import org.apache.sling.api.resource.ResourceUtil;
@@ -53,7 +54,6 @@
5354
import com.adobe.cq.wcm.core.components.models.datalayer.ComponentData;
5455
import com.day.cq.dam.api.Asset;
5556
import com.day.cq.wcm.api.Page;
56-
import com.google.common.collect.ImmutableList;
5757

5858
import io.wcm.handler.link.type.InternalLinkType;
5959
import io.wcm.sling.commons.adapter.AdaptTo;
@@ -132,7 +132,7 @@ void testTeaserResource_with_LinksDescriptionsImage() {
132132
PN_LINK_ITEMS, true));
133133
List underTest = AdaptTo.notNull(context.request(), List.class);
134134

135-
java.util.List<ListItem> items = ImmutableList.copyOf(underTest.getListItems());
135+
java.util.List<ListItem> items = new ArrayList<>(underTest.getListItems());
136136
assertListItems(items, page1, page2, page3);
137137

138138
ValueMap props1 = ResourceUtil.getValueMap(items.get(0).getTeaserResource());
@@ -164,7 +164,7 @@ void testTeaserResource_no_LinksDescriptionsImage() {
164164
PN_SOURCE, "children"));
165165
List underTest = AdaptTo.notNull(context.request(), List.class);
166166

167-
java.util.List<ListItem> items = ImmutableList.copyOf(underTest.getListItems());
167+
java.util.List<ListItem> items = new ArrayList<>(underTest.getListItems());
168168
assertListItems(items, page1, page2, page3);
169169

170170
ValueMap props1 = ResourceUtil.getValueMap(items.get(0).getTeaserResource());

bundles/core/src/test/java/io/wcm/wcm/core/components/impl/util/CoreResourceWrapperTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.util.Collections;
3333
import java.util.HashMap;
3434
import java.util.Map;
35+
import java.util.Set;
3536

3637
import org.apache.sling.api.resource.Resource;
3738
import org.apache.sling.api.resource.ResourceResolver;
@@ -40,8 +41,6 @@
4041
import org.junit.jupiter.api.Test;
4142
import org.junit.jupiter.api.extension.ExtendWith;
4243

43-
import com.google.common.collect.ImmutableSet;
44-
4544
import io.wcm.sling.commons.resource.ImmutableValueMap;
4645
import io.wcm.testing.mock.aem.junit5.AemContext;
4746
import io.wcm.testing.mock.aem.junit5.AemContextExtension;
@@ -75,7 +74,7 @@ void testWrappingWithHiddenProperties() {
7574
"a", 1,
7675
"b", 2,
7776
ResourceResolver.PROPERTY_RESOURCE_TYPE, "a/b/c");
78-
Resource wrappedResource = new CoreResourceWrapper(resource, "d/e/f", null, ImmutableSet.of("b"));
77+
Resource wrappedResource = new CoreResourceWrapper(resource, "d/e/f", null, Set.of("b"));
7978

8079
Map<String, Object> expectedProperties = new HashMap<>(resource.getValueMap());
8180
expectedProperties.put(ResourceResolver.PROPERTY_RESOURCE_TYPE, "d/e/f");

bundles/core/src/test/java/io/wcm/wcm/core/components/testcontext/ImageAreaTestData.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.jetbrains.annotations.Nullable;
2828

2929
import com.adobe.cq.wcm.core.components.models.ImageArea;
30-
import com.google.common.collect.ImmutableList;
3130

3231
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
3332
import io.wcm.handler.link.Link;
@@ -55,7 +54,7 @@ private ImageAreaTestData() {
5554
@SuppressFBWarnings("NP_NULL_ON_SOME_PATH")
5655
public static List<ImageArea> getExpectedAreasV1(AemContext context) {
5756
ImageMapLinkResolver<Link> imageMapLinkResolver = context.getService(ImageMapLinkResolver.class);
58-
return ImmutableList.of(
57+
return List.of(
5958
areaV1("circle", "256,256,256", "0.2000,0.3001,0.2000",
6059
imageMapLinkResolver.resolveLink("http://myhost", null, context.currentResource()),
6160
"http://myhost", null, null),

bundles/core/src/test/java/io/wcm/wcm/core/components/testcontext/MediaHandlerConfigImpl.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
import org.jetbrains.annotations.NotNull;
2525

26-
import com.google.common.collect.ImmutableList;
27-
2826
import io.wcm.handler.media.spi.MediaHandlerConfig;
2927
import io.wcm.handler.media.spi.MediaSource;
3028
import io.wcm.handler.mediasource.dam.DamMediaSource;
@@ -35,7 +33,7 @@
3533
*/
3634
public class MediaHandlerConfigImpl extends MediaHandlerConfig {
3735

38-
private static final List<Class<? extends MediaSource>> MEDIA_SOURCES = ImmutableList.<Class<? extends MediaSource>>of(
36+
private static final List<Class<? extends MediaSource>> MEDIA_SOURCES = List.of(
3937
DamMediaSource.class,
4038
InlineMediaSource.class);
4139

0 commit comments

Comments
 (0)