Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Problem

Projects created with the Adobe AEM Project Archteype with Version 17 or lower do not include a dependency to AEM Mocks, but only a dependency to Apache Sling Mocks. This makes it difficult to write unit tests for code that uses the AEM API, because complex objects like Page, PageManager, Asset etc. need to be mocked manually. This article describes how to switch from Sling Mocks to AEM Mocks.

...

Step 1 - Switch to AEM Mock Dependency (mandatory)

Info

For projects created with Adobe AEM Project Archetype Version 18 this step can be skipped, as the AEM Mocks dependency is already included.

You have to change the dependencies in two POMs to make AEM Mocks available:

...

Page Properties
hiddentrue


Related issues