@ProviderType public final class AemContextBuilder extends Object
AemContext instances with different sets of parameters.| Constructor and Description |
|---|
AemContextBuilder()
Create builder with default resource resolver type.
|
AemContextBuilder(@NotNull org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType)
Create builder with given resource resolver type.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends org.apache.sling.testing.mock.osgi.context.OsgiContextImpl> |
afterSetUp(org.apache.sling.testing.mock.osgi.context.ContextCallback<T>... afterSetUpCallback) |
<T extends org.apache.sling.testing.mock.osgi.context.OsgiContextImpl> |
afterTearDown(org.apache.sling.testing.mock.osgi.context.ContextCallback<T>... afterTearDownCallback) |
<T extends org.apache.sling.testing.mock.osgi.context.OsgiContextImpl> |
beforeSetUp(org.apache.sling.testing.mock.osgi.context.ContextCallback<T>... beforeSetUpCallback) |
<T extends org.apache.sling.testing.mock.osgi.context.OsgiContextImpl> |
beforeTearDown(org.apache.sling.testing.mock.osgi.context.ContextCallback<T>... beforeTearDownCallback) |
@NotNull AemContext |
build() |
<T extends org.apache.sling.testing.mock.osgi.context.OsgiContextImpl> |
plugin(org.apache.sling.testing.mock.osgi.context.ContextPlugin<T>... plugin) |
@NotNull AemContextBuilder |
registerSlingModelsFromClassPath(boolean value)
Automatic registering of all Sling Models found in the classpath on startup (active by default).
|
@NotNull AemContextBuilder |
resourceResolverFactoryActivatorProps(@NotNull Map<String,Object> props)
Allows to override OSGi configuration parameters for the Resource Resolver Factory Activator service.
|
@NotNull AemContextBuilder |
resourceResolverType(@NotNull org.apache.sling.testing.mock.sling.ResourceResolverType type) |
public AemContextBuilder()
public AemContextBuilder(@NotNull
@NotNull org.apache.sling.testing.mock.sling.ResourceResolverType resourceResolverType)
resourceResolverType - Resource resolver type.@NotNull public @NotNull AemContextBuilder resourceResolverType(@NotNull @NotNull org.apache.sling.testing.mock.sling.ResourceResolverType type)
type - Resource resolver type.@SafeVarargs @NotNull public final <T extends org.apache.sling.testing.mock.osgi.context.OsgiContextImpl> @NotNull AemContextBuilder plugin(@NotNull org.apache.sling.testing.mock.osgi.context.ContextPlugin<T>... plugin)
T - context typeplugin - Context plugin which listens to context lifecycle events.@SafeVarargs @NotNull public final <T extends org.apache.sling.testing.mock.osgi.context.OsgiContextImpl> @NotNull AemContextBuilder beforeSetUp(@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<T>... beforeSetUpCallback)
T - context typebeforeSetUpCallback - Allows the application to register an own callback function that is called before the
built-in setup rules are executed.@SafeVarargs @NotNull public final <T extends org.apache.sling.testing.mock.osgi.context.OsgiContextImpl> @NotNull AemContextBuilder afterSetUp(@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<T>... afterSetUpCallback)
T - context typeafterSetUpCallback - Allows the application to register an own callback function that is called after the
built-in setup rules are executed.@SafeVarargs @NotNull public final <T extends org.apache.sling.testing.mock.osgi.context.OsgiContextImpl> @NotNull AemContextBuilder beforeTearDown(@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<T>... beforeTearDownCallback)
T - context typebeforeTearDownCallback - Allows the application to register an own callback function that is called before the
built-in teardown rules are executed.@SafeVarargs @NotNull public final <T extends org.apache.sling.testing.mock.osgi.context.OsgiContextImpl> @NotNull AemContextBuilder afterTearDown(@NotNull org.apache.sling.testing.mock.osgi.context.ContextCallback<T>... afterTearDownCallback)
T - context typeafterTearDownCallback - Allows the application to register an own callback function that is after before the
built-in teardown rules are executed.@NotNull public @NotNull AemContextBuilder resourceResolverFactoryActivatorProps(@NotNull @NotNull Map<String,Object> props)
props - Configuration properties@NotNull public @NotNull AemContextBuilder registerSlingModelsFromClassPath(boolean value)
value - If set to false Sling Models are not registered automatically from the classpath on startup.@NotNull public @NotNull AemContext build()
AemContext instance.Copyright © 2014–2019 wcm.io. All rights reserved.