hello danijel.
if you want the exact same behavior/JCR data structure used in your unit test as in the running AEM instance, the same persistence strategy implementation with the same configuration has to be configured. e.g. in case your are using the “AEM Page” persistence strategy from https://wcm.io/caconfig/extensions/ you have to register and configure the related OSGi service in your unit test as well. if you did not use the persistence strategy from https://wcm.io/caconfig/extensions/, a default persistence strategy from AEM itself is in place, which is not available in unit tests.
however, in most cases it should not be important to configure the correct persistence strategy for the unit tests – if you are only reading/writing the data via the Context-Aware Configuration APIs, it does not play a role if the JCR structure is the same as in AEM or not. but you are right, if using nested caconfigs things get a bit tricky, and the node names/node hierarchy like “sub” may be slightly different in unit tests than in the real environment.
stefan
--
You received this message because you are subscribed to the Google Groups "wcm-io Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
wcm-io-dev+...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/wcm-io-dev/CAHy%3D9eAy7s%2B9pYjbNRqEFpOGC-UMiMr155NNPZ5UM73YssPTrw%40mail.gmail.com.