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.
MockAsset
extendsResourceWrapper
and implementsAsset
.The
adaptTo
-method is overwritten with a simple check to return the correct resource, but adapting to other types goes toResourceWrapper#adaptTo
, which uses the wrappedResource
to do the adaption. In the end, this means that the wrappedResource
will always end up in theAdapterFactory
, and not theAsset
itself.