How to read jcr:created when using AEM mocks



In the application code, I am reading jcr:created using ValueMap API but when I load content JSON file to the AemContext object I don't see the property(only jcr:created) and getting "null" when I try to read. I am currently using RESOURCERESOLVER_MOCK and I also tried with JCR_MOCK. 


When I searched for this issue I have seen a thread but it doesn't really have an answer on how to solve this problem.


AEM mocks version: 3.0.2


AEM AEM mocks junit

Accepted Solutions (1)

Accepted Solutions (1)






This problem is more related to sling-mock of the Apache Sling project than to itself, because it affects the ContentLoader from sling-mock. the ContentLoader [1] has a default list of properties that is ignored when loading content, and "jcr:created" is one of them.



I would suggest for now, you can ignore test cases for jcr:created date.

Answers (0)