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
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.server.WebSession
getAttribute, getAttributeOrDefault, getRequiredAttribute
-
Constructor Details
-
MockWebSession
public MockWebSession() -
MockWebSession
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceorg.springframework.web.server.WebSession
-
getAttributes
- Specified by:
getAttributes
in interfaceorg.springframework.web.server.WebSession
-
start
public void start()- Specified by:
start
in interfaceorg.springframework.web.server.WebSession
-
isStarted
public boolean isStarted()- Specified by:
isStarted
in interfaceorg.springframework.web.server.WebSession
-
changeSessionId
- Specified by:
changeSessionId
in interfaceorg.springframework.web.server.WebSession
-
invalidate
- Specified by:
invalidate
in interfaceorg.springframework.web.server.WebSession
-
save
- Specified by:
save
in interfaceorg.springframework.web.server.WebSession
-
isExpired
public boolean isExpired()- Specified by:
isExpired
in interfaceorg.springframework.web.server.WebSession
-
getCreationTime
- Specified by:
getCreationTime
in interfaceorg.springframework.web.server.WebSession
-
getLastAccessTime
- Specified by:
getLastAccessTime
in interfaceorg.springframework.web.server.WebSession
-
setMaxIdleTime
- Specified by:
setMaxIdleTime
in interfaceorg.springframework.web.server.WebSession
-
getMaxIdleTime
- Specified by:
getMaxIdleTime
in interfaceorg.springframework.web.server.WebSession
-