Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Jan 12, 2023
2 parents 6fd2dee + 3f59220 commit 7d1bed2
Show file tree
Hide file tree
Showing 29 changed files with 104 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [8, 11, 17]
java: [11, 17]
os: [ubuntu-latest]
distribution: [temurin]

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Deploy snapshots to Sonatpe OSS repository and deploy site to GitHub Pages
# Deploy snapshots to Sonatype OSS repository and deploy site to GitHub Pages

name: Deploy

Expand All @@ -15,19 +15,19 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Configure GIT
run: |
git config --global user.email "${{ secrets.GH_SITE_DEPLOY_EMAIL }}"
git config --global user.name "${{ secrets.GH_SITE_DEPLOY_NAME }}"
- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
cache: 'maven'
java-version: 11
cache: maven

- name: Build, verify, deploy, generate site
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ncipollo/release-action@v1
with:
body: 'Changes: https://wcm.io/wcm/core-components/changes-report.html'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<img src="https://wcm.io/images/favicon-16@2x.png"/> wcm.io WCM Core Components
======
[![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)
[![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)
[![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/)
[![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)

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

Documentation: https://wcm.io/wcm/core-components/<br/>
Issues: https://wcm-io.atlassian.net/browse/WWCM<br/>
Issues: https://github.com/wcm-io/io.wcm.wcm.core.components/issues<br/>
Wiki: https://wcm-io.atlassian.net/wiki/<br/>
Continuous Integration: https://github.com/wcm-io/io.wcm.wcm.core.components/actions<br/>
Commercial support: https://wcm.io/commercial-support.html
Expand Down
2 changes: 1 addition & 1 deletion build-deploy_aem65.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi
# install AEM 6.5 with service pack
mvn --non-recursive wcmio-content-package:install \
--activate-profiles=${MAVEN_PROFILES} \
-Dvault.artifact=adobe.binary.aem.65.servicepack:aem-service-pkg:zip:6.5.13.0 \
-Dvault.artifact=adobe.binary.aem.65.servicepack:aem-service-pkg:zip:6.5.15.0 \
-Dvault.delayAfterInstallSec=30

if [ "$?" -ne "0" ]; then
Expand Down
4 changes: 2 additions & 2 deletions bundles/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
<version>1.12.0-2.20.0</version>
<version>1.12.2-2.21.2</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.core.components</artifactId>
<version>1.12.0-2.20.0</version>
<version>1.12.2-2.21.2</version>
<packaging>jar</packaging>

<name>WCM Core Components</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import com.google.common.collect.ImmutableSet;

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

/**
* Constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Map;

import org.apache.sling.api.resource.Resource;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.day.cq.dam.api.Asset;
import com.day.cq.wcm.api.Page;
import com.google.common.collect.ImmutableMap;

import ch.randelshofer.io.ByteArrayImageInputStream;
import io.wcm.handler.link.LinkHandler;
Expand Down Expand Up @@ -89,7 +90,7 @@ void testPageLink() {
assertEquals(url, underTest.getURL());
assertEquals(url, underTest.getMappedURL());
assertEquals(url, underTest.getExternalizedURL());
assertEquals(ImmutableMap.of("href", url), underTest.getHtmlAttributes());
assertEquals(Map.of("href", url), underTest.getHtmlAttributes());
assertEquals(page, underTest.getReference());
assertNotNull(underTest.getLinkObject());

Expand All @@ -107,7 +108,7 @@ void testAssetLink() {
assertEquals(url, underTest.getURL());
assertEquals(url, underTest.getMappedURL());
assertEquals(url, underTest.getExternalizedURL());
assertEquals(ImmutableMap.of("href", url), underTest.getHtmlAttributes());
assertEquals(Map.of("href", url), underTest.getHtmlAttributes());
assertTrue(underTest.getReference() instanceof io.wcm.handler.media.Asset);
assertEquals(asset.getPath(), ((io.wcm.handler.media.Asset)underTest.getReference()).getPath());
assertNotNull(underTest.getLinkObject());
Expand All @@ -130,7 +131,7 @@ void testExternalLink() {
assertEquals(url, underTest.getURL());
assertEquals(url, underTest.getMappedURL());
assertEquals(url, underTest.getExternalizedURL());
assertEquals(ImmutableMap.of("href", url, "target", target), underTest.getHtmlAttributes());
assertEquals(Map.of("href", url, "target", target), underTest.getHtmlAttributes());
assertNull(underTest.getReference());
assertNotNull(underTest.getLinkObject());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import com.adobe.cq.wcm.core.components.models.NavigationItem;
import com.adobe.cq.wcm.core.components.models.datalayer.ComponentData;
import com.day.cq.wcm.api.Page;
import com.google.common.collect.ImmutableList;

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

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

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

List<ListItem> itemsList = ImmutableList.copyOf(items);
List<ListItem> itemsList = List.copyOf(items);
for (int i = 0; i < items.size(); i++) {
Page page = pages[i];
ListItem item = itemsList.get(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Collections;
import java.util.Locale;

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

import com.adobe.cq.wcm.core.components.models.LanguageNavigationItem;
import com.day.cq.wcm.api.Page;
import com.google.common.collect.ImmutableList;

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

assertEquals(page.getPath(), underTest.getPage().getPath());
assertTrue(underTest.isActive());
assertTrue(underTest.isCurrent());
assertEquals(ImmutableList.of(), underTest.getChildren());
assertEquals(Collections.emptyList(), underTest.getChildren());
assertEquals(5, underTest.getLevel());

assertEquals("My Title", underTest.getTitle());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Collections;
import java.util.Locale;

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

import com.adobe.cq.wcm.core.components.models.LanguageNavigationItem;
import com.day.cq.wcm.api.Page;
import com.google.common.collect.ImmutableList;

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

assertEquals(page.getPath(), underTest.getPage().getPath());
assertTrue(underTest.isActive());
assertTrue(underTest.isCurrent());
assertEquals(ImmutableList.of(), underTest.getChildren());
assertEquals(Collections.emptyList(), underTest.getChildren());
assertEquals(5, underTest.getLevel());

assertEquals("My Title", underTest.getTitle());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Collections;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.adobe.cq.wcm.core.components.models.NavigationItem;
import com.day.cq.wcm.api.Page;
import com.google.common.collect.ImmutableList;

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

assertEquals(page.getPath(), underTest.getPage().getPath());
assertTrue(underTest.isActive());
assertTrue(underTest.isCurrent());
assertEquals(ImmutableList.of(), underTest.getChildren());
assertEquals(Collections.emptyList(), underTest.getChildren());
assertEquals(5, underTest.getLevel());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Collections;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.adobe.cq.wcm.core.components.models.NavigationItem;
import com.day.cq.wcm.api.Page;
import com.google.common.collect.ImmutableList;

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

assertEquals(page.getPath(), underTest.getPage().getPath());
assertTrue(underTest.isActive());
assertTrue(underTest.isCurrent());
assertEquals(ImmutableList.of(), underTest.getChildren());
assertEquals(Collections.emptyList(), underTest.getChildren());
assertEquals(5, underTest.getLevel());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

import java.util.ArrayList;
import java.util.Collection;

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

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

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

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

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

ValueMap props1 = ResourceUtil.getValueMap(items.get(0).getTeaserResource());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
Expand All @@ -40,8 +41,6 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.google.common.collect.ImmutableSet;

import io.wcm.sling.commons.resource.ImmutableValueMap;
import io.wcm.testing.mock.aem.junit5.AemContext;
import io.wcm.testing.mock.aem.junit5.AemContextExtension;
Expand Down Expand Up @@ -75,7 +74,7 @@ void testWrappingWithHiddenProperties() {
"a", 1,
"b", 2,
ResourceResolver.PROPERTY_RESOURCE_TYPE, "a/b/c");
Resource wrappedResource = new CoreResourceWrapper(resource, "d/e/f", null, ImmutableSet.of("b"));
Resource wrappedResource = new CoreResourceWrapper(resource, "d/e/f", null, Set.of("b"));

Map<String, Object> expectedProperties = new HashMap<>(resource.getValueMap());
expectedProperties.put(ResourceResolver.PROPERTY_RESOURCE_TYPE, "d/e/f");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.jetbrains.annotations.Nullable;

import com.adobe.cq.wcm.core.components.models.ImageArea;
import com.google.common.collect.ImmutableList;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.wcm.handler.link.Link;
Expand Down Expand Up @@ -55,7 +54,7 @@ private ImageAreaTestData() {
@SuppressFBWarnings("NP_NULL_ON_SOME_PATH")
public static List<ImageArea> getExpectedAreasV1(AemContext context) {
ImageMapLinkResolver<Link> imageMapLinkResolver = context.getService(ImageMapLinkResolver.class);
return ImmutableList.of(
return List.of(
areaV1("circle", "256,256,256", "0.2000,0.3001,0.2000",
imageMapLinkResolver.resolveLink("http://myhost", null, context.currentResource()),
"http://myhost", null, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

import org.jetbrains.annotations.NotNull;

import com.google.common.collect.ImmutableList;

import io.wcm.handler.media.spi.MediaHandlerConfig;
import io.wcm.handler.media.spi.MediaSource;
import io.wcm.handler.mediasource.dam.DamMediaSource;
Expand All @@ -35,7 +33,7 @@
*/
public class MediaHandlerConfigImpl extends MediaHandlerConfig {

private static final List<Class<? extends MediaSource>> MEDIA_SOURCES = ImmutableList.<Class<? extends MediaSource>>of(
private static final List<Class<? extends MediaSource>> MEDIA_SOURCES = List.of(
DamMediaSource.class,
InlineMediaSource.class);

Expand Down
Loading

0 comments on commit 7d1bed2

Please sign in to comment.