About AEM Mocks

Mock implementation of selected AEM APIs.

Maven Central

Version Support Matrix

AEM Mock version AEM version supported JUnit version supported
AEM Mock 2.x AEM 6.2 or up JUnit 4, JUnit 5
AEM Mock 1.x AEM 6.0 or 6.1 JUnit 4

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

Back to top

Version: 2.3.5-SNAPSHOT. Last Published: 2019-01-17.