Class MockServletRegistration

java.lang.Object
com.foreach.across.test.AbstractMockRegistration
com.foreach.across.test.MockServletRegistration
All Implemented Interfaces:
jakarta.servlet.Registration, jakarta.servlet.Registration.Dynamic, jakarta.servlet.ServletConfig, jakarta.servlet.ServletRegistration, jakarta.servlet.ServletRegistration.Dynamic

public class MockServletRegistration extends AbstractMockRegistration implements jakarta.servlet.ServletRegistration.Dynamic, jakarta.servlet.ServletConfig
Mock version of a ServletRegistration.Dynamic that does nothing but keep a number of configured properties. Support is limited and only intended in combination with MockAcrossServletContext.
Author:
Marc Vanbrabant, Arne Vandamme
  • Method Details

    • getServletName

      public String getServletName()
      Specified by:
      getServletName in interface jakarta.servlet.ServletConfig
      Returns:
      servlet name
    • getServlet

      public jakarta.servlet.Servlet getServlet()
      Returns:
      filter instance if configured
    • getServletClass

      public Class<? extends jakarta.servlet.Servlet> getServletClass()
      Returns:
      filter class if configured
    • setLoadOnStartup

      public void setLoadOnStartup(int loadOnStartup)
      Specified by:
      setLoadOnStartup in interface jakarta.servlet.ServletRegistration.Dynamic
    • setServletSecurity

      public Set<String> setServletSecurity(jakarta.servlet.ServletSecurityElement servletSecurity)
      Specified by:
      setServletSecurity in interface jakarta.servlet.ServletRegistration.Dynamic
    • setMultipartConfig

      public void setMultipartConfig(jakarta.servlet.MultipartConfigElement multipartConfig)
      Specified by:
      setMultipartConfig in interface jakarta.servlet.ServletRegistration.Dynamic
    • setRunAsRole

      public void setRunAsRole(String roleName)
      Specified by:
      setRunAsRole in interface jakarta.servlet.ServletRegistration.Dynamic
    • addMapping

      public Set<String> addMapping(String... urlPatterns)
      Specified by:
      addMapping in interface jakarta.servlet.ServletRegistration
    • getMappings

      public Collection<String> getMappings()
      Specified by:
      getMappings in interface jakarta.servlet.ServletRegistration
    • getRunAsRole

      public String getRunAsRole()
      Specified by:
      getRunAsRole in interface jakarta.servlet.ServletRegistration
    • getLoadOnStartup

      public int getLoadOnStartup()
    • getServletSecurity

      public jakarta.servlet.ServletSecurityElement getServletSecurity()
    • getMultipartConfig

      public jakarta.servlet.MultipartConfigElement getMultipartConfig()