Class MockWebSession
java.lang.Object
org.springframework.mock.web.server.MockWebSession
- All Implemented Interfaces:
org.springframework.web.server.WebSession
Implementation of
WebSession that delegates to a session instance
obtained via InMemoryWebSessionStore.
This is intended for use with the
session(WebSession)
method of the MockServerWebExchange builder, eliminating the need
to use WebSessionManager or WebSessionStore altogether.
- Since:
- 5.1
- Author:
- Rossen Stoyanchev
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.server.WebSession
getAttribute, getAttributeOrDefault, getRequiredAttribute
-
Constructor Details
-
MockWebSession
public MockWebSession() -
MockWebSession
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceorg.springframework.web.server.WebSession
-
getAttributes
- Specified by:
getAttributesin interfaceorg.springframework.web.server.WebSession
-
start
public void start()- Specified by:
startin interfaceorg.springframework.web.server.WebSession
-
isStarted
public boolean isStarted()- Specified by:
isStartedin interfaceorg.springframework.web.server.WebSession
-
changeSessionId
- Specified by:
changeSessionIdin interfaceorg.springframework.web.server.WebSession
-
invalidate
- Specified by:
invalidatein interfaceorg.springframework.web.server.WebSession
-
save
- Specified by:
savein interfaceorg.springframework.web.server.WebSession
-
isExpired
public boolean isExpired()- Specified by:
isExpiredin interfaceorg.springframework.web.server.WebSession
-
getCreationTime
- Specified by:
getCreationTimein interfaceorg.springframework.web.server.WebSession
-
getLastAccessTime
- Specified by:
getLastAccessTimein interfaceorg.springframework.web.server.WebSession
-
setMaxIdleTime
- Specified by:
setMaxIdleTimein interfaceorg.springframework.web.server.WebSession
-
getMaxIdleTime
- Specified by:
getMaxIdleTimein interfaceorg.springframework.web.server.WebSession
-