Skip to content

Commit

Permalink
Make compatible with CFM API from AEMaaCS 2024.3.15575.20240318T21481…
Browse files Browse the repository at this point in the history
…4Z-231200
  • Loading branch information
stefanseifert committed Apr 8, 2024
1 parent 25ed521 commit 0524d08
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 67 deletions.
36 changes: 24 additions & 12 deletions core/src/main/java/io/wcm/testing/mock/aem/MockContentFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
import com.adobe.cq.dam.cfm.FragmentTemplate;
import com.adobe.cq.dam.cfm.VariationDef;
import com.adobe.cq.dam.cfm.VariationTemplate;
import com.adobe.cq.dam.cfm.VersionDef;
import com.adobe.cq.dam.cfm.VersionedContent;
import com.day.cq.commons.jcr.JcrConstants;
import com.day.cq.dam.api.Asset;
import com.day.cq.dam.api.DamConstants;
Expand All @@ -50,7 +52,7 @@
/**
* Mock implementation of {@link ContentFragment}.
*/
final class MockContentFragment extends MockContentFragment_Versionable implements ContentFragment {
final class MockContentFragment implements ContentFragment {

private final Resource assetResource;
private final Asset asset;
Expand Down Expand Up @@ -261,45 +263,55 @@ public void removeVariation(String variation) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

// latest AEM Cloud API
@Override
public @Nullable Calendar getLastModifiedDate() {
throw new UnsupportedOperationException();
}

// latest AEM Cloud API
@Override
@SuppressWarnings("unused")
public @NotNull Calendar getLastModifiedDeep() throws ContentFragmentException {
throw new UnsupportedOperationException();
}

// latest AEM Cloud API
@Override
@SuppressWarnings("unused")
public void setTags(@NotNull Tag[] tags) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

// latest AEM Cloud API
@Override
@SuppressWarnings("unused")
public @NotNull Tag[] getTags() throws ContentFragmentException {
throw new UnsupportedOperationException();
}

// latest AEM Cloud API
@Override
@SuppressWarnings("unused")
public void setVariationTags(@NotNull Tag[] tags, @NotNull String variationName) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

// latest AEM Cloud API
@Override
@SuppressWarnings("unused")
public @NotNull Tag[] getVariationTags(@NotNull String variationName) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public VersionDef createVersion(String label, String comment) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public VersionedContent getVersionedContent(VersionDef version) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public Iterator<VersionDef> listVersions() throws ContentFragmentException {
throw new UnsupportedOperationException();
}

// latest AEM Cloud API
@SuppressWarnings("unused")
public ContentFragment getVersion(VersionDef versionDef) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@
import com.adobe.cq.dam.cfm.FragmentData;
import com.adobe.cq.dam.cfm.VariationDef;
import com.adobe.cq.dam.cfm.VariationTemplate;
import com.adobe.cq.dam.cfm.VersionDef;
import com.adobe.cq.dam.cfm.VersionedContent;
import com.day.cq.commons.jcr.JcrConstants;

/**
* Mock implementation of {@link ContentElement} for structured content.
*/
class MockContentFragment_ContentElement_Structured extends MockContentFragment_Versionable implements ContentElement {
class MockContentFragment_ContentElement_Structured implements ContentElement {

private final MockContentFragment contentFragment;
private final String structuredDataKey;
Expand Down Expand Up @@ -178,4 +180,25 @@ public void setValue(FragmentData fragmentData) throws ContentFragmentException
throw new UnsupportedOperationException();
}

@Override
public VersionDef createVersion(String label, String comment) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public VersionedContent getVersionedContent(VersionDef version) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public Iterator<VersionDef> listVersions() throws ContentFragmentException {
throw new UnsupportedOperationException();
}

// latest AEM Cloud API
@SuppressWarnings("unused")
public ContentElement getVersion(VersionDef versionDef) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import com.adobe.cq.dam.cfm.FragmentData;
import com.adobe.cq.dam.cfm.VariationDef;
import com.adobe.cq.dam.cfm.VariationTemplate;
import com.adobe.cq.dam.cfm.VersionDef;
import com.adobe.cq.dam.cfm.VersionedContent;
import com.day.cq.commons.jcr.JcrConstants;
import com.day.cq.dam.api.Asset;
import com.day.cq.dam.api.DamConstants;
Expand All @@ -49,7 +51,7 @@
/**
* Mock implementation of {@link ContentElement} for text-based content.
*/
class MockContentFragment_ContentElement_Text extends MockContentFragment_Versionable implements ContentElement {
class MockContentFragment_ContentElement_Text implements ContentElement {

private final MockContentFragment contentFragment;
private final Resource textElementResource;
Expand Down Expand Up @@ -184,4 +186,25 @@ public void setValue(FragmentData arg0) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public VersionDef createVersion(String label, String comment) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public VersionedContent getVersionedContent(VersionDef version) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public Iterator<VersionDef> listVersions() throws ContentFragmentException {
throw new UnsupportedOperationException();
}

// latest AEM Cloud API
@SuppressWarnings("unused")
public ContentElement getVersion(VersionDef versionDef) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package io.wcm.testing.mock.aem;

import java.util.Calendar;
import java.util.Iterator;

import org.apache.sling.api.resource.ModifiableValueMap;
import org.jetbrains.annotations.NotNull;
Expand All @@ -29,11 +30,13 @@
import com.adobe.cq.dam.cfm.FragmentData;
import com.adobe.cq.dam.cfm.SyncStatus;
import com.adobe.cq.dam.cfm.VariationDef;
import com.adobe.cq.dam.cfm.VersionDef;
import com.adobe.cq.dam.cfm.VersionedContent;

/**
* Mock implementation of {@link ContentVariation}.
*/
class MockContentFragment_ContentVariation_Structured extends MockContentFragment_Versionable implements ContentVariation {
class MockContentFragment_ContentVariation_Structured implements ContentVariation {

private final VariationDef variationDef;
private final String structuredDataKey;
Expand Down Expand Up @@ -110,8 +113,30 @@ public void setValue(FragmentData arg0) throws ContentFragmentException {
}

// latest AEM Cloud API
@Override
public @NotNull Calendar getCreated() {
throw new UnsupportedOperationException();
}

@Override
public VersionDef createVersion(String label, String comment) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public VersionedContent getVersionedContent(VersionDef version) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public Iterator<VersionDef> listVersions() throws ContentFragmentException {
throw new UnsupportedOperationException();
}

// latest AEM Cloud API
@SuppressWarnings("unused")
public ContentVariation getVersion(VersionDef versionDef) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package io.wcm.testing.mock.aem;

import java.util.Calendar;
import java.util.Iterator;

import org.jetbrains.annotations.NotNull;

Expand All @@ -28,12 +29,14 @@
import com.adobe.cq.dam.cfm.FragmentData;
import com.adobe.cq.dam.cfm.SyncStatus;
import com.adobe.cq.dam.cfm.VariationDef;
import com.adobe.cq.dam.cfm.VersionDef;
import com.adobe.cq.dam.cfm.VersionedContent;
import com.day.cq.dam.api.Asset;

/**
* Mock implementation of {@link ContentVariation}.
*/
class MockContentFragment_ContentVariation_Text extends MockContentFragment_Versionable implements ContentVariation {
class MockContentFragment_ContentVariation_Text implements ContentVariation {

private final VariationDef variationDef;
private final Asset asset;
Expand Down Expand Up @@ -107,8 +110,30 @@ public void setValue(FragmentData fragmentDataq) throws ContentFragmentException
}

// latest AEM Cloud API
@Override
public @NotNull Calendar getCreated() {
throw new UnsupportedOperationException();
}

@Override
public VersionDef createVersion(String label, String comment) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public VersionedContent getVersionedContent(VersionDef version) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

@Override
public Iterator<VersionDef> listVersions() throws ContentFragmentException {
throw new UnsupportedOperationException();
}

// latest AEM Cloud API
@SuppressWarnings("unused")
public ContentVariation getVersion(VersionDef versionDef) throws ContentFragmentException {
throw new UnsupportedOperationException();
}

}

This file was deleted.

0 comments on commit 0524d08

Please sign in to comment.