Class MockSpringServletService

  • All Implemented Interfaces:
    java.io.Serializable

    
    public class MockSpringServletService
    extends 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 (otherwise the mocked servlet env will crash).
    • Provides a MockSpringVaadinSession instead of com.vaadin.flow.spring.SpringVaadinSession.
    The class is intentionally opened, to be extensible in user's library.
    Author:

    mavi

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      MockSpringServletService(MockSpringServlet servlet, DeploymentConfiguration deploymentConfiguration, ApplicationContext ctx, Function0<UI> uiFactory)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getMainDivId(VaadinSession session, VaadinRequest request)
      Instantiator getInstantiator()
      • Methods inherited from class com.vaadin.flow.server.VaadinServletService

        getContextRootRelativePath, getCurrentResponse, getCurrentServletRequest, getMimeType, getResource, getResourceAsStream, getResourceInServletContext, getServiceName, getServlet, resolveResource
      • Methods inherited from class com.vaadin.flow.server.VaadinService

        accessSession, addServiceDestroyListener, addSessionDestroyListener, addSessionInitListener, addUIInitListener, closeSession, createCriticalNotificationJSON, createSessionExpiredJSON, createUINotFoundJSON, destroy, ensureAccessQueuePurged, ensurePushAvailable, findUI, findVaadinSession, fireSessionDestroy, fireUIInitListeners, getBootstrapInitialPredicate, getBootstrapUrlPredicate, getClassLoader, getContext, getCsrfTokenAttributeName, getCurrent, getCurrentRequest, getCurrentResponse, getDependencyFilters, getDeploymentConfiguration, getInstantiator, getRequestHandlers, getRouter, getSystemMessages, getSystemMessagesProvider, getVaadinRequestInterceptors, handleRequest, isCsrfTokenValid, isOtherSessionLocked, isResourceAvailable, isUIActive, modifyIndexHtmlResponse, reinitializeSession, removeSession, requestEnd, requestStart, runPendingAccessTasks, setBootstrapInitialPredicate, setBootstrapUrlPredicate, setClassLoader, setCurrent, setCurrentInstances, setSystemMessagesProvider, verifyNoOtherSessionLocked, writeStringResponse, writeUncachedStringResponse
      • Methods inherited from class com.vaadin.flow.spring.SpringVaadinServletService

        getStaticResource, init
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MockSpringServletService

        MockSpringServletService(MockSpringServlet servlet, DeploymentConfiguration deploymentConfiguration, ApplicationContext ctx, Function0<UI> uiFactory)