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
FieldsModifier and TypeFieldDescriptionfinal @NotNull org.springframework.context.ApplicationContextfinal @NotNull com.github.mvysny.kaributesting.v10.Routesfinal @NotNull kotlin.jvm.functions.Function0<com.vaadin.flow.component.UI>Fields inherited from class com.vaadin.flow.spring.SpringServlet
PROPERTY_NAMESFields inherited from class com.vaadin.flow.server.VaadinServlet
INTERNAL_VAADIN_SERVLET_VITE_DEV_MODE_FRONTEND_PATH -
Constructor Summary
ConstructorsConstructorDescriptionMockSpringServlet(@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 TypeMethodDescriptionprotected com.vaadin.flow.function.DeploymentConfigurationprotected com.vaadin.flow.server.VaadinServletServicecreateServletService(com.vaadin.flow.function.DeploymentConfiguration deploymentConfiguration) voidinit(jakarta.servlet.ServletConfig servletConfig) Methods inherited from class com.vaadin.flow.spring.SpringServlet
createDeploymentConfiguration, serviceMethods inherited from class com.vaadin.flow.server.VaadinServlet
createServletService, createStaticFileHandler, createVaadinRequest, destroy, getCurrent, getFrontendMapping, getLastPathParameter, getService, getServletConfig, handleContextOrServletRootWithoutSlash, serveStaticOrWebJarRequest, servletInitialized, whenFrontendMappingAvailableMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletContext, getServletInfo, getServletName, init, log, log
-
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:
createDeploymentConfigurationin classcom.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:
createServletServicein classcom.vaadin.flow.spring.SpringServlet- Throws:
com.vaadin.flow.server.ServiceException
-
init
public void init(jakarta.servlet.ServletConfig servletConfig) throws jakarta.servlet.ServletException - Specified by:
initin interfacejakarta.servlet.Servlet- Overrides:
initin classcom.vaadin.flow.server.VaadinServlet- Throws:
jakarta.servlet.ServletException
-