You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AEM comes with com.day.cq.wcm.core.impl.TemplatedResourceAdapterFactory that allows you to take a current resource that is linked to a template, and merge in the template structure items in order to get a full picture of the resource and its properties. Using AEM Mock, however, adapting a resource (or request) to TemplatedResource.class appears to always result in null, preventing testing of code that relies on this capability, such as code calling com.adobe.cq.wcm.core.components.util.ComponentUtils#getEffectiveResource from WCM Core.
The text was updated successfully, but these errors were encountered:
true - the problem that it's not only com.day.cq.wcm.core.impl.TemplatedResourceAdapterFactory is missing, but the whole implementation of the interface com.day.cq.wcm.api.TemplatedResource as well - the related impl classes are not part of the API JAR. so it is more effort to reimplement all the contained functionality.
Understood. Unfortunately I likely wont have time to spend creating a full-on implementation of this adapter (as you alluded to, it's a decent amount of code to produce). For now I've solved in my local implementation with a bit of a hack that wraps the templated resource (but doesn't actually merge it together with the content resource) and that works for my tests, but I don't think that would suffice for this library.
If this issue is simply "yep, it's an issue, but no one has time to fix so we're going to close" I understand.
AEM comes with
com.day.cq.wcm.core.impl.TemplatedResourceAdapterFactory
that allows you to take a current resource that is linked to a template, and merge in the template structure items in order to get a full picture of the resource and its properties. Using AEM Mock, however, adapting a resource (or request) toTemplatedResource.class
appears to always result in null, preventing testing of code that relies on this capability, such as code callingcom.adobe.cq.wcm.core.components.util.ComponentUtils#getEffectiveResource
from WCM Core.The text was updated successfully, but these errors were encountered: