wcm-io / io.wcm.testing.aem-mock

Mock implementation of selected AEM APIs.
Apache License 2.0
1 stars 9 forks source link

Support adaptions from MockAsset to other types than Resource #40

Open henrykuijpers opened 1 month ago

henrykuijpers commented 1 month ago

MockAsset extends ResourceWrapper and implements Asset.

The adaptTo-method is overwritten with a simple check to return the correct resource, but adapting to other types goes to ResourceWrapper#adaptTo, which uses the wrapped Resource to do the adaption. In the end, this means that the wrapped Resource will always end up in the AdapterFactory, and not the Asset itself.

stefanseifert commented 1 month ago

i'm not sure if i fully understand what's missing - can you come up with a PR?