About AEM Mocks

Mock implementation of selected AEM APIs.

Maven Central

AEM Support

You should pick the major version of AEM Mock depending on your AEM version:

  • AEM 6.0 or 6.1: use AEM Mock 1.x
  • AEM 6.2 or above: use AEM Mock 2.x

Implemented mock features

The mock implementation supports:

  • Access to mocked OSGi, mocked JCR and mocked Sling environment provided by the Apache Sling project
  • Resource access using different resource resolver types (see Resource Resolver Types)
  • Implementation of AEM WCM API objects PageManager, Page, Template, ComponentManager, Component, TagManager, Tag, Designer, ComponentContext, EditContext, EditConfig
  • Implementation of AEM DAM API objects Asset and Rendition
  • JUnit rule AemContext for easy access to all context objects and registering adapter factories and OSGi services
  • Import and create test content for unit tests (see Test content loading and creation)
  • Registers OSGi services and adapter factories supported by the mock implementations
  • Full support for Sling Models
  • Setting run modes
  • Layer adapter factory
  • Context Plugins

The following features are not supported:

  • Other parts of the AEM API

Back to top

Version: 2.2.7-SNAPSHOT. Last Published: 2017-07-06.