Class 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()  
      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 getRequest()  
      @NotNull org.apache.sling.api.SlingHttpServletResponse getResponse()  
      @NotNull org.apache.sling.api.scripting.SlingScript getScript()  
      <ServiceType>
      ServiceType
      getService​(@NotNull Class<ServiceType> serviceType)  
      <ServiceType>
      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)  
    • Constructor Detail

      • 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)
    • Method Detail

      • 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

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

        public <ServiceType> 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)
      • 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