Package com.vaadin.testbench.unit.mocks
See: Description
-
Class Summary Class Description MockSpringServlet Makes sure that the routes are properly registered, and that MockSpringServletService is used instead of vanilla com.vaadin.flow.spring.SpringVaadinServletService. MockSpringServletService 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.
MockSpringVaadinSession A Vaadin Session with one important difference: - Creates a new session when this one is closed. This is used to simulate a logout which closes the session - we need to have a new fresh session to be able to continue testing. In order to do that, simply override close, call `super.close()` then call afterSessionClose.
MockWebApplicationContext An adapter to make a generic Spring ApplicationContext act like a WebApplicationContext. SpringSecurityRequestCustomizer Configures mock request with authentication details from Spring Security. MockContext MockServletConfig MockHttpSession A standalone implementation of the HttpSession interface. MockInstantiator Makes sure to load MockNpmTemplateParser. MockRequest MockResponse MockService 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 MockVaadinSession. The class is intentionally opened, to be extensible in user's library.
MockServiceinstance, override MockVaadinServlet.createServletService.MockVaadinServlet Makes sure that routes are properly registered, and that MockService is used instead of vanilla VaadinServletService. MockVaadinSession A Vaadin Session with one important difference: Creates a new session when this one is closed. This is used to simulate a logout which closes the session - we need to have a new fresh session to be able to continue testing. In order to do that, simply override close, call
super.close()then call MockVaadin.afterSessionClose.
MockedUI A simple no-op UI used by default by com.vaadin.testbench.unit.MockVaadin. SessionAttributeMapKt -
Object Summary Object Description MockHttpEnvironment Companion MockVaadinHelper