Test classes for AEM 6 | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Ove_Lindström

Same way as you Mock any any interface. But, beware, you eventually will end up mocking the whole AEM (or it will feel like it).

In many cases, the Sling Test framework provides a better solution. Take a look at http://sling.apache.org/documentation/tutorials-how-tos/testing-sling-based-applications.html

"it felt safer to test it in a realistic situation rather than mock everything." - Could not agree more.

/Ove

1 reply

Ove_LindströmAccepted solution
Level 6
October 16, 2015

Same way as you Mock any any interface. But, beware, you eventually will end up mocking the whole AEM (or it will feel like it).

In many cases, the Sling Test framework provides a better solution. Take a look at http://sling.apache.org/documentation/tutorials-how-tos/testing-sling-based-applications.html

"it felt safer to test it in a realistic situation rather than mock everything." - Could not agree more.

/Ove