Package com.vaadin.testbench.unit.mocks
Class MockSpringVaadinSession
-
- All Implemented Interfaces:
-
jakarta.servlet.http.HttpSessionBindingListener,java.io.Serializable,java.util.EventListener
public class MockSpringVaadinSession extends SpringVaadinSessionA 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.
mavi
-
-
Field Summary
Fields Modifier and Type Field Description public DeploymentConfigurationconfigurationpublic Localelocalepublic ErrorHandlererrorHandlerpublic longcumulativeRequestDurationpublic longlastRequestDurationpublic longlastRequestTimestamppublic VaadinSessionStatestatepublic transient WrappedSessionsessionpublic transient VaadinServiceservicepublic final StringpushIdpublic transient StreamResourceRegistryresourceRegistrypublic longlastUnlockedpublic longlastLocked
-
Constructor Summary
Constructors Constructor Description MockSpringVaadinSession(VaadinService service, Function0<UI> uiFactory)
-
Method Summary
Modifier and Type Method Description voidclose()-
Methods inherited from class com.vaadin.flow.server.VaadinSession
access, accessSynchronously, addRequestHandler, addSessionDestroyListener, addUI, checkHasLock, findElement, getAllSessions, getAttribute, getAttribute, getBrowser, getConfiguration, getCumulativeRequestDuration, getCurrent, getErrorHandler, getLastLocked, getLastRequestDuration, getLastRequestTimestamp, getLastUnlocked, getLocale, getLockInstance, getNextUIid, getPendingAccessQueue, getPushId, getRequestHandlers, getResourceRegistry, getService, getSession, getState, getUIById, getUIs, hasLock, lock, refreshTransients, removeRequestHandler, removeUI, setAttribute, setBrowser, setConfiguration, setCurrent, setErrorHandler, setLastRequestDuration, setLastRequestTimestamp, setLocale, unlock, valueBound, valueUnbound -
Methods inherited from class com.vaadin.flow.spring.SpringVaadinSession
addDestroyListener, fireSessionDestroy -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
close
void close()
-
-
-
-