About AEM Mocks

Mock implementation of selected AEM APIs.

Maven Central

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, Style, ContentPolicy, ContentPolicyMapping, ContentPolicyManager
  • Implementation of AEM DAM API objects Asset, Rendition, ContentFragment, AssetStore, AssetHandler.
  • Implementation of AEM Granite API objects ResourceCollectionManager, ResourceCollection
  • 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

AEM Version Support Matrix

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

Back to top

Version: 2.6.1-SNAPSHOT. Last Published: 2019-08-13.