Class OsgiContextBuilder
java.lang.Object
org.apache.sling.testing.mock.osgi.junit5.OsgiContextBuilder
Builder class for creating
OsgiContext
instances with different sets
of parameters.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal OsgiContextBuilder
afterSetUp
(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterSetUpCallback) final OsgiContextBuilder
afterTearDown
(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterTearDownCallback) final OsgiContextBuilder
beforeSetUp
(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeSetUpCallback) final OsgiContextBuilder
beforeTearDown
(@NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeTearDownCallback) @NotNull OsgiContext
build()
final OsgiContextBuilder
plugin
(@NotNull ContextPlugin<? extends OsgiContextImpl> @NotNull ... plugin)
-
Constructor Details
-
OsgiContextBuilder
public OsgiContextBuilder()Create builder.
-
-
Method Details
-
plugin
@SafeVarargs public final OsgiContextBuilder plugin(@NotNull @NotNull ContextPlugin<? extends OsgiContextImpl> @NotNull ... plugin) - Parameters:
plugin
- Context plugin which listens to context lifecycle events.- Returns:
- this
-
beforeSetUp
@SafeVarargs public final OsgiContextBuilder beforeSetUp(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeSetUpCallback) - Parameters:
beforeSetUpCallback
- Allows the application to register an own callback function that is called before the built-in setup rules are executed.- Returns:
- this
-
afterSetUp
@SafeVarargs public final OsgiContextBuilder afterSetUp(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterSetUpCallback) - Parameters:
afterSetUpCallback
- Allows the application to register an own callback function that is called after the built-in setup rules are executed.- Returns:
- this
-
beforeTearDown
@SafeVarargs public final OsgiContextBuilder beforeTearDown(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... beforeTearDownCallback) - Parameters:
beforeTearDownCallback
- Allows the application to register an own callback function that is called before the built-in teardown rules are executed.- Returns:
- this
-
afterTearDown
@SafeVarargs public final OsgiContextBuilder afterTearDown(@NotNull @NotNull ContextCallback<? extends OsgiContextImpl> @NotNull ... afterTearDownCallback) - Parameters:
afterTearDownCallback
- Allows the application to register an own callback function that is after before the built-in teardown rules are executed.- Returns:
- this
-
build
- Returns:
- Build
OsgiContext
instance.
-