Add support for Apache Sling Models Impl >= 1.5.0

Description

Sling Models Impl >= 1.5.0 included an issue that has a behaviour change - https://issues.apache.org/jira/browse/SLING-5726.

If a Sling Model adapts from a SlingHttpServletRequest and a model's field is annotated only with @Inject, it could be that the field is now set to a value extracted from the current resource's ValueMap.

Activity

Show:

Stefan Seifert January 27, 2022 at 8:43 PM
Edited

aem mocks/sling mocks uses the real sling models implementation in the mock context.

so, there is usually no need to change anything in AEM mocks or sling mocks if new features are added - just make sure the correct version of sling models impl is running in your test classpath (and not the quite old version that comes as transitive dependency for compatibility with older AEM versions).

i recommend to use this approach: https://wcm.io/testing/aem-mock/usage-maven-dependencies.html#Further_Sling_and_AEM_dependencies

Details

Assignee

Reporter

Components

Priority

Created January 25, 2022 at 1:44 PM
Updated January 27, 2022 at 8:43 PM