Class SlingContext

java.lang.Object
org.apache.sling.testing.mock.osgi.context.OsgiContextImpl
org.apache.sling.testing.mock.sling.context.SlingContextImpl
org.apache.sling.testing.mock.sling.junit5.SlingContext

@ConsumerType public final class SlingContext extends SlingContextImpl
Sling Mock parameter object with resource resolver type defaulting to ResourceResolverType.RESOURCERESOLVER_MOCK.

Additionally you can subclass this class and provide further parameters via SlingContextBuilder.

  • Constructor Details

    • SlingContext

      public SlingContext()
      Initialize Sling context.
    • SlingContext

      public SlingContext(@NotNull @NotNull ResourceResolverType resourceResolverType)
      Initialize Sling context.
      Parameters:
      resourceResolverType - Resource resolver type.
  • Method Details

    • setUpContext

      protected void setUpContext()
      This is called by SlingContextExtension to set up context.
    • tearDownContext

      protected void tearDownContext()
      This is called by SlingContextExtension to tear down context.