Skip to content

Commit

Permalink
Add tests for the adaption
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Teeuwen committed Oct 13, 2023
1 parent c8338db commit 2230d8c
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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", ""));
Expand Down

0 comments on commit 2230d8c

Please sign in to comment.