From 2230d8c518f379653167ee2e09a0bf04f4efdf84 Mon Sep 17 00:00:00 2001 From: Roy Teeuwen Date: Fri, 13 Oct 2023 08:45:36 +0200 Subject: [PATCH] Add tests for the adaption --- .../mock/aem/xf/MockExperienceFragmentTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/src/test/java/io/wcm/testing/mock/aem/xf/MockExperienceFragmentTest.java b/core/src/test/java/io/wcm/testing/mock/aem/xf/MockExperienceFragmentTest.java index 3648efe9..09e72b2a 100644 --- a/core/src/test/java/io/wcm/testing/mock/aem/xf/MockExperienceFragmentTest.java +++ b/core/src/test/java/io/wcm/testing/mock/aem/xf/MockExperienceFragmentTest.java @@ -58,6 +58,11 @@ public void testExperienceFragment() { ExperienceFragment experienceFragment = xfPage.adaptTo(ExperienceFragment.class); assertNotNull(experienceFragment); + Resource adaptedResource = experienceFragment.adaptTo(Resource.class); + assertEquals(xfResource, adaptedResource); + Page adaptedPage = experienceFragment.adaptTo(Page.class); + assertEquals(xfPage, adaptedPage); + assertEquals("/content/experience-fragments/sample", experienceFragment.getPath()); assertEquals("/conf/something", experienceFragment.getCloudserviceConfigurationsPaths().get(0)); assertEquals(2, experienceFragment.getVariations().size()); @@ -75,6 +80,11 @@ public void testExperienceFragmentVariation() { ExperienceFragmentVariation variation = masterPage.adaptTo(ExperienceFragmentVariation.class); assertNotNull(variation); + Resource adaptedResource = variation.adaptTo(Resource.class); + assertEquals(masterResource, adaptedResource); + Page adaptedPage = variation.adaptTo(Page.class); + assertEquals(masterPage, adaptedPage); + assertEquals("/content/experience-fragments/sample/master", variation.getPath()); assertEquals("/conf/something", variation.getCloudserviceConfigurationsPaths().get(0)); assertEquals("/conf/something", variation.getPropertiesTree().getInherited("cq:cloudserviceconfigs", ""));