Package com.vaadin.browserless.mocks
Class MockSpringServletService
java.lang.Object
com.vaadin.flow.server.VaadinService
com.vaadin.flow.server.VaadinServletService
com.vaadin.flow.spring.SpringVaadinServletService
com.vaadin.browserless.mocks.MockSpringServletService
- All Implemented Interfaces:
Serializable
public class MockSpringServletService
extends com.vaadin.flow.spring.SpringVaadinServletService
A mocking service that performs three very important tasks:
- Overrides
isAtmosphereAvailable()to tell Vaadin that we don't have Atmosphere (otherwise Vaadin will crash) - Provides some dummy value as a root ID via
getMainDivId(com.vaadin.flow.server.VaadinSession, com.vaadin.flow.server.VaadinRequest)(otherwise the mocked servlet env will crash). - Provides a
MockSpringVaadinSessioninstead ofcom.vaadin.flow.spring.SpringVaadinSession.
- Author:
- mavi
- See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.server.VaadinService
ATMOSPHERE_MISSING_ERROR, INVALID_ATMOSPHERE_VERSION_WARNING -
Constructor Summary
ConstructorsConstructorDescriptionMockSpringServletService(MockSpringServlet servlet, com.vaadin.flow.function.DeploymentConfiguration deploymentConfiguration, org.springframework.context.ApplicationContext ctx, com.vaadin.browserless.internal.UIFactory uiFactory) MockSpringServletService(MockSpringServlet servlet, com.vaadin.flow.function.DeploymentConfiguration deploymentConfiguration, org.springframework.context.ApplicationContext ctx, kotlin.jvm.functions.Function0<com.vaadin.flow.component.UI> uiFactory) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.vaadin.flow.server.VaadinSessioncreateVaadinSession(com.vaadin.flow.server.VaadinRequest request) com.vaadin.flow.di.InstantiatorgetMainDivId(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinRequest request) protected booleanMethods inherited from class com.vaadin.flow.spring.SpringVaadinServletService
createDefaultExecutor, getExecutor, getStaticResource, init, loadInstantiatorsMethods inherited from class com.vaadin.flow.server.VaadinServletService
constructVaadinContext, createRequestHandlers, getContextRootRelativePath, getCurrentResponse, getCurrentServletRequest, getMimeType, getPwaRegistry, getResource, getResourceAsStream, getResourceInServletContext, getRouteRegistry, getServiceName, getServlet, requestCanCreateSession, resolveResource, setDefaultClassLoaderMethods inherited from class com.vaadin.flow.server.VaadinService
accessSession, addServiceDestroyListener, addSessionDestroyListener, addSessionInitListener, addUIInitListener, closeSession, createCriticalNotificationJSON, createCriticalNotificationJSON, createDefaultObjectMapper, createInstantiator, createSessionExpiredJSON, createUINotFoundJSON, createVaadinRequestInterceptors, destroy, ensureAccessQueuePurged, ensurePushAvailable, findUI, findVaadinSession, fireSessionDestroy, fireUIInitListeners, getBootstrapInitialPredicate, getBootstrapUrlPredicate, getClassLoader, getContext, getCsrfTokenAttributeName, getCurrent, getCurrentRequest, getDependencyFilters, getDeploymentConfiguration, getExistingSession, getRequestHandlers, getRouter, getSessionAttributeName, getSessionLock, getSystemMessages, getSystemMessagesProvider, getVaadinRequestInterceptors, handleRequest, handleSessionExpired, isCsrfTokenValid, isOtherSessionLocked, isResourceAvailable, isUIActive, loadSession, lockSession, modifyIndexHtmlResponse, readFromHttpSession, reinitializeSession, removeFromHttpSession, removeSession, requestEnd, requestStart, runPendingAccessTasks, setBootstrapInitialPredicate, setBootstrapUrlPredicate, setClassLoader, setCurrent, setCurrentInstances, setSystemMessagesProvider, storeSession, unlockSession, verifyNoOtherSessionLocked, writeStringResponse, writeToHttpSession, writeUncachedStringResponse
-
Constructor Details
-
MockSpringServletService
@Deprecated(forRemoval=true) public MockSpringServletService(@NotNull MockSpringServlet servlet, @NotNull com.vaadin.flow.function.DeploymentConfiguration deploymentConfiguration, @NotNull org.springframework.context.ApplicationContext ctx, @NotNull kotlin.jvm.functions.Function0<com.vaadin.flow.component.UI> uiFactory) Deprecated, for removal: This API element is subject to removal in a future version. -
MockSpringServletService
public MockSpringServletService(@NotNull MockSpringServlet servlet, @NotNull com.vaadin.flow.function.DeploymentConfiguration deploymentConfiguration, @NotNull org.springframework.context.ApplicationContext ctx, @NotNull com.vaadin.browserless.internal.UIFactory uiFactory)
-
-
Method Details
-
isAtmosphereAvailable
protected boolean isAtmosphereAvailable()- Overrides:
isAtmosphereAvailablein classcom.vaadin.flow.server.VaadinService
-
getMainDivId
public String getMainDivId(com.vaadin.flow.server.VaadinSession session, com.vaadin.flow.server.VaadinRequest request) - Overrides:
getMainDivIdin classcom.vaadin.flow.server.VaadinServletService
-
createVaadinSession
protected com.vaadin.flow.server.VaadinSession createVaadinSession(com.vaadin.flow.server.VaadinRequest request) - Overrides:
createVaadinSessionin classcom.vaadin.flow.server.VaadinService
-
getInstantiator
public com.vaadin.flow.di.Instantiator getInstantiator()- Overrides:
getInstantiatorin classcom.vaadin.flow.server.VaadinService
-