We're updating the issue view to help you get more done. 

Include ExperienceFragmentsAdapaterFactory by default in aemContext

Description

When using ExperienceFragments, adapting from a Page to an ExperienceFragment or ExperienceFragmentVariation will return null by default. A workaround for this is to register the AdapterFactory manually:

1 2 3 4 5 6 7 8 9 10 11 //load appropriate resources aemContext.registerInjectActivateService(new ExperienceFragmentsServiceFactoryImpl()); aemContext.registerInjectActivateService(new ExperienceFragmentsAdapaterFactory()); PageManager pageManager = aemContext.pageManager(); Page page = pageManager.getPage("/path/to/loaded/resources"); ExperienceFragmentVariation xfVariation = page.adaptTo(ExperienceFragmentVariation.class);

It would be an improvement to have these Services/Factories registered by default.

Environment

None

Status

Assignee

Unassigned

Reporter

Lukas Kummer

Labels

None

Components

Affects versions

AEM Mocks 2.2.12

Priority

Minor