Class MockSpringServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
com.vaadin.flow.server.VaadinServlet
com.vaadin.flow.spring.SpringServlet
com.github.mvysny.kaributesting.v10.spring.MockSpringServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class MockSpringServlet extends com.vaadin.flow.spring.SpringServlet
Makes sure that the routes are properly registered, and that MockSpringServletService is used instead of vanilla SpringVaadinServletService.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final @NotNull org.springframework.context.ApplicationContext
     
    final @NotNull com.github.mvysny.kaributesting.v10.Routes
     
    final @NotNull kotlin.jvm.functions.Function0<com.vaadin.flow.component.UI>
     

    Fields inherited from class com.vaadin.flow.spring.SpringServlet

    PROPERTY_NAMES

    Fields inherited from class com.vaadin.flow.server.VaadinServlet

    INTERNAL_VAADIN_SERVLET_VITE_DEV_MODE_FRONTEND_PATH
  • Constructor Summary

    Constructors
    Constructor
    Description
    MockSpringServlet(@NotNull com.github.mvysny.kaributesting.v10.Routes routes, @NotNull org.springframework.context.ApplicationContext ctx, @NotNull kotlin.jvm.functions.Function0<com.vaadin.flow.component.UI> uiFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected com.vaadin.flow.function.DeploymentConfiguration
     
    protected com.vaadin.flow.server.VaadinServletService
    createServletService(com.vaadin.flow.function.DeploymentConfiguration deploymentConfiguration)
     
    void
    init(jakarta.servlet.ServletConfig servletConfig)
     

    Methods inherited from class com.vaadin.flow.spring.SpringServlet

    createDeploymentConfiguration, service

    Methods inherited from class com.vaadin.flow.server.VaadinServlet

    createServletService, createStaticFileHandler, createVaadinRequest, destroy, getCurrent, getFrontendMapping, getLastPathParameter, getService, getServletConfig, handleContextOrServletRootWithoutSlash, serveStaticOrWebJarRequest, servletInitialized, whenFrontendMappingAvailable

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service

    Methods inherited from class jakarta.servlet.GenericServlet

    getInitParameter, getInitParameterNames, getServletContext, getServletInfo, getServletName, init, log, log

    Methods inherited from class java.lang.Object

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

    • routes

      @NotNull public final @NotNull com.github.mvysny.kaributesting.v10.Routes routes
    • ctx

      @NotNull public final @NotNull org.springframework.context.ApplicationContext ctx
    • uiFactory

      @NotNull public final @NotNull kotlin.jvm.functions.Function0<com.vaadin.flow.component.UI> uiFactory
  • Constructor Details

    • MockSpringServlet

      public MockSpringServlet(@NotNull @NotNull com.github.mvysny.kaributesting.v10.Routes routes, @NotNull @NotNull org.springframework.context.ApplicationContext ctx, @NotNull @NotNull kotlin.jvm.functions.Function0<com.vaadin.flow.component.UI> uiFactory)
  • Method Details

    • createDeploymentConfiguration

      protected com.vaadin.flow.function.DeploymentConfiguration createDeploymentConfiguration() throws jakarta.servlet.ServletException
      Overrides:
      createDeploymentConfiguration in class com.vaadin.flow.server.VaadinServlet
      Throws:
      jakarta.servlet.ServletException
    • createServletService

      protected com.vaadin.flow.server.VaadinServletService createServletService(com.vaadin.flow.function.DeploymentConfiguration deploymentConfiguration) throws com.vaadin.flow.server.ServiceException
      Overrides:
      createServletService in class com.vaadin.flow.spring.SpringServlet
      Throws:
      com.vaadin.flow.server.ServiceException
    • init

      public void init(jakarta.servlet.ServletConfig servletConfig) throws jakarta.servlet.ServletException
      Specified by:
      init in interface jakarta.servlet.Servlet
      Overrides:
      init in class com.vaadin.flow.server.VaadinServlet
      Throws:
      jakarta.servlet.ServletException