@ConsumerType
public class AemContextImpl
extends org.apache.sling.testing.mock.sling.context.SlingContextImpl
| Constructor and Description |
|---|
AemContextImpl() |
| Modifier and Type | Method and Description |
|---|---|
@NotNull com.day.cq.dam.api.AssetManager |
assetManager() |
@NotNull ContentBuilder |
create() |
@Nullable com.day.cq.wcm.api.Page |
currentPage() |
@Nullable com.day.cq.wcm.api.Page |
currentPage(@Nullable com.day.cq.wcm.api.Page page)
Set current Page in request (via
ComponentContext). |
@Nullable com.day.cq.wcm.api.Page |
currentPage(@Nullable String pagePath)
Set current Page in request (via
ComponentContext). |
protected @NotNull org.apache.sling.api.resource.ResourceResolverFactory |
newResourceResolverFactory() |
@NotNull com.day.cq.wcm.api.PageManager |
pageManager() |
protected void |
registerDefaultServices() |
protected Map<String,Object> |
resourceResolverFactoryActivatorPropsMergeWithAemDefault(@Nullable Map<String,Object> customProps)
Merges the given custom Resource Resolver Factory Activator OSGi configuration with the default configuration
applied in AEM 6.
|
protected void |
setResourceResolverType(@Nullable org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType) |
protected void |
setUp() |
protected void |
tearDown() |
@NotNull UniqueRoot |
uniqueRoot()
Create unique root paths for unit tests (and clean them up after the test run automatically).
|
addModelsForClasses, addModelsForClasses, addModelsForPackage, addModelsForPackage, build, currentResource, currentResource, currentResource, load, load, registerAdapter, registerAdapter, request, requestPathInfo, resourceResolver, resourceResolverType, response, runMode, setRegisterSlingModelsFromClassPath, setResourceResolverFactoryActivatorProps, slingScriptHelperbundleContext, componentContext, getService, getServices, registerInjectActivateService, registerInjectActivateService, registerInjectActivateService, registerService, registerService, registerService, registerServiceprotected void registerDefaultServices()
registerDefaultServices in class org.apache.sling.testing.mock.sling.context.SlingContextImplprotected void setResourceResolverType(@Nullable
@Nullable org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType)
setResourceResolverType in class org.apache.sling.testing.mock.sling.context.SlingContextImpl@NotNull protected @NotNull org.apache.sling.api.resource.ResourceResolverFactory newResourceResolverFactory()
newResourceResolverFactory in class org.apache.sling.testing.mock.sling.context.SlingContextImplprotected void setUp()
setUp in class org.apache.sling.testing.mock.sling.context.SlingContextImplprotected void tearDown()
tearDown in class org.apache.sling.testing.mock.sling.context.SlingContextImplprotected final Map<String,Object> resourceResolverFactoryActivatorPropsMergeWithAemDefault(@Nullable @Nullable Map<String,Object> customProps)
customProps - Custom config@NotNull public @NotNull com.day.cq.wcm.api.PageManager pageManager()
@NotNull public @NotNull com.day.cq.dam.api.AssetManager assetManager()
@NotNull public @NotNull ContentBuilder create()
create in class org.apache.sling.testing.mock.sling.context.SlingContextImpl@Nullable public @Nullable com.day.cq.wcm.api.Page currentPage()
ComponentContext. If none is set the page containing the current resource.
Null if no containing page exists.@Nullable
public @Nullable com.day.cq.wcm.api.Page currentPage(@Nullable
@Nullable String pagePath)
ComponentContext).
This also sets the current resource to the content resource of the page.
You can set it to a different resources afterwards if required.pagePath - Page path@Nullable
public @Nullable com.day.cq.wcm.api.Page currentPage(@Nullable
@Nullable com.day.cq.wcm.api.Page page)
ComponentContext).
This also sets the current resource to the content resource of the page.
You can set it to a different resources afterwards if required.page - Page@NotNull public @NotNull UniqueRoot uniqueRoot()
uniqueRoot in class org.apache.sling.testing.mock.sling.context.SlingContextImplCopyright © 2014–2018 wcm.io. All rights reserved.