*** The wcm.io Project is closing down this JIRA Instance in favor of GitHub issues. *** Please use the corresponding GitHub projects to report issues - or the mailing list for general discussion.

Issues

Select view

Select search mode

 
50 of 74

The MockAemAdapterFactory doesn't correctly adapt a Resource to a ContentFragment

Description

The following lines of code are wrong when trying to adapt a Resource to a ContentFragment: https://github.com/wcm-io/io.wcm.testing.aem-mock/blob/7d822c2e53e4539c4f1d702ebafa4896995ae7f0/core/src/main/java/io/wcm/testing/mock/aem/MockAemAdapterFactory.java#L101-L103

A ContentFragment is an Asset that has the contentFragment boolean property set to true on the jcr:content sub-node of type dam:AssetContent. Moreover, a valid ContentFragment has a model, which the MockContentFragment also doesn’t seem to support.

Details

Assignee

Reporter

Components

Affects versions

Priority

Created October 6, 2022 at 11:28 AM
Updated October 18, 2022 at 8:09 AM

Activity

Show:

Stefan SeifertOctober 18, 2022 at 8:09 AM

i tried to reproduce what AEM is doing internally when adapting to a ContentFragment - it seems the contentFragment=true property is not actually evaluated - but a lot of other stuff that is currently respect in AEM mocks, e.g. existence of the jcr:content/data node, existence of a model path on cq:model property etc.

indeed AEM mocks currently does not have support for CFM models (the interface is named FragmentTemplate in the API).

adding full CFM model support would be a bigger effort. if anyone can come up with a PR i would be glad to help to bring it into AEM mocks.

Stefan SeifertOctober 6, 2022 at 12:03 PM

thanks for reporting, i'll have a look