List of Context Plugins
This page lists all AEM Mocks Context Plugins that are available. These plugins hook into the AEM Mocks Lifecyle and register all OSGi services that are required to test the use cases.
Usage Example
Example of a "AppAemContext" class which can be used in all your unit test classes to create a preconfigured AemContext object with all you need in your project.
Code Block |
---|
|
import static io.wcm.testing.mock.wcmio.caconfig.ContextPlugins.WCMIO_CACONFIG;
import static org.apache.sling.testing.mock.caconfig.ContextPlugins.CACONFIG;
import io.wcm.testing.mock.aem.junit5.AemContext;
import io.wcm.testing.mock.aem.junit5.AemContextBuilder;
public class AppAemContext {
public static AemContext newAemContext() {
return new AemContextBuilder()
// register plugins
.plugin(CACONFIG)
.plugin(WCMIO_CACONFIG)
.build();
}
} |