Class MockSlingScriptHelper

java.lang.Object
org.apache.sling.testing.mock.sling.MockSlingScriptHelper
All Implemented Interfaces:
org.apache.sling.api.scripting.SlingScriptHelper

public final class MockSlingScriptHelper extends Object implements org.apache.sling.api.scripting.SlingScriptHelper
Mock SlingScriptHelper implementation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MockSlingScriptHelper(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response, @NotNull org.osgi.framework.BundleContext bundleContext)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    forward(@NotNull String path)
     
    void
    forward(@NotNull String path, String requestDispatcherOptions)
     
    void
    forward(@NotNull String path, org.apache.sling.api.request.RequestDispatcherOptions requestDispatcherOptions)
     
    void
    forward(@NotNull org.apache.sling.api.resource.Resource resource)
     
    void
    forward(@NotNull org.apache.sling.api.resource.Resource resource, String requestDispatcherOptions)
     
    void
    forward(@NotNull org.apache.sling.api.resource.Resource resource, org.apache.sling.api.request.RequestDispatcherOptions requestDispatcherOptions)
     
    @NotNull org.apache.sling.api.SlingHttpServletRequest
     
    @NotNull org.apache.sling.api.SlingHttpServletResponse
     
    @NotNull org.apache.sling.api.scripting.SlingScript
     
    <ServiceType>
    ServiceType
    getService(@NotNull Class<ServiceType> serviceType)
     
    <ServiceType>
    @Nullable ServiceType[]
    getServices(@NotNull Class<ServiceType> serviceType, String filter)
     
    void
    include(@NotNull String path)
     
    void
    include(@NotNull String path, String requestDispatcherOptions)
     
    void
    include(@NotNull String path, org.apache.sling.api.request.RequestDispatcherOptions requestDispatcherOptions)
     
    void
    include(@NotNull org.apache.sling.api.resource.Resource resource)
     
    void
    include(@NotNull org.apache.sling.api.resource.Resource resource, String requestDispatcherOptions)
     
    void
    include(@NotNull org.apache.sling.api.resource.Resource resource, org.apache.sling.api.request.RequestDispatcherOptions requestDispatcherOptions)
     
    void
    setScript(@NotNull org.apache.sling.api.scripting.SlingScript script)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MockSlingScriptHelper

      public MockSlingScriptHelper(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull org.apache.sling.api.SlingHttpServletResponse response, @NotNull @NotNull org.osgi.framework.BundleContext bundleContext)
      Parameters:
      request - Sling HTTP servlet request
      response - Sling HTTP servlet response
      bundleContext - OSGi bundle context
  • Method Details

    • getRequest

      @NotNull public @NotNull org.apache.sling.api.SlingHttpServletRequest getRequest()
      Specified by:
      getRequest in interface org.apache.sling.api.scripting.SlingScriptHelper
    • getResponse

      @NotNull public @NotNull org.apache.sling.api.SlingHttpServletResponse getResponse()
      Specified by:
      getResponse in interface org.apache.sling.api.scripting.SlingScriptHelper
    • getService

      @Nullable public <ServiceType> ServiceType getService(@NotNull @NotNull Class<ServiceType> serviceType)
      Specified by:
      getService in interface org.apache.sling.api.scripting.SlingScriptHelper
    • getServices

      @Nullable public <ServiceType> @Nullable ServiceType[] getServices(@NotNull @NotNull Class<ServiceType> serviceType, String filter)
      Specified by:
      getServices in interface org.apache.sling.api.scripting.SlingScriptHelper
    • getScript

      @NotNull public @NotNull org.apache.sling.api.scripting.SlingScript getScript()
      Specified by:
      getScript in interface org.apache.sling.api.scripting.SlingScriptHelper
    • setScript

      public void setScript(@NotNull @NotNull org.apache.sling.api.scripting.SlingScript script)
      Parameters:
      script - Script
    • dispose

      public void dispose()
      Specified by:
      dispose in interface org.apache.sling.api.scripting.SlingScriptHelper
    • forward

      public void forward(@NotNull @NotNull String path, org.apache.sling.api.request.RequestDispatcherOptions requestDispatcherOptions)
      Specified by:
      forward in interface org.apache.sling.api.scripting.SlingScriptHelper
    • forward

      public void forward(@NotNull @NotNull String path, String requestDispatcherOptions)
      Specified by:
      forward in interface org.apache.sling.api.scripting.SlingScriptHelper
    • forward

      public void forward(@NotNull @NotNull String path)
      Specified by:
      forward in interface org.apache.sling.api.scripting.SlingScriptHelper
    • forward

      public void forward(@NotNull @NotNull org.apache.sling.api.resource.Resource resource)
      Specified by:
      forward in interface org.apache.sling.api.scripting.SlingScriptHelper
    • forward

      public void forward(@NotNull @NotNull org.apache.sling.api.resource.Resource resource, String requestDispatcherOptions)
      Specified by:
      forward in interface org.apache.sling.api.scripting.SlingScriptHelper
    • forward

      public void forward(@NotNull @NotNull org.apache.sling.api.resource.Resource resource, org.apache.sling.api.request.RequestDispatcherOptions requestDispatcherOptions)
      Specified by:
      forward in interface org.apache.sling.api.scripting.SlingScriptHelper
    • include

      public void include(@NotNull @NotNull String path, org.apache.sling.api.request.RequestDispatcherOptions requestDispatcherOptions)
      Specified by:
      include in interface org.apache.sling.api.scripting.SlingScriptHelper
    • include

      public void include(@NotNull @NotNull String path, String requestDispatcherOptions)
      Specified by:
      include in interface org.apache.sling.api.scripting.SlingScriptHelper
    • include

      public void include(@NotNull @NotNull String path)
      Specified by:
      include in interface org.apache.sling.api.scripting.SlingScriptHelper
    • include

      public void include(@NotNull @NotNull org.apache.sling.api.resource.Resource resource)
      Specified by:
      include in interface org.apache.sling.api.scripting.SlingScriptHelper
    • include

      public void include(@NotNull @NotNull org.apache.sling.api.resource.Resource resource, String requestDispatcherOptions)
      Specified by:
      include in interface org.apache.sling.api.scripting.SlingScriptHelper
    • include

      public void include(@NotNull @NotNull org.apache.sling.api.resource.Resource resource, org.apache.sling.api.request.RequestDispatcherOptions requestDispatcherOptions)
      Specified by:
      include in interface org.apache.sling.api.scripting.SlingScriptHelper