Package com.vaadin.testbench.unit.mocks
Class MockHttpSession
-
- All Implemented Interfaces:
-
jakarta.servlet.http.HttpSession,java.io.Serializable
public class MockHttpSession implements HttpSession, Serializable
A standalone implementation of the HttpSession interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMockHttpSession.Companion
-
Field Summary
Fields Modifier and Type Field Description private final BooleanisValidpublic final static MockHttpSession.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description MockHttpSession(HttpSession session)MockHttpSession(String sessionId, ServletContext servletContext, Long creationTime, Integer maxInactiveInterval)
-
Method Summary
Modifier and Type Method Description final BooleanisValid()final Unitdestroy()LonggetCreationTime()StringgetId()LonggetLastAccessedTime()ServletContextgetServletContext()UnitsetMaxInactiveInterval(Integer interval)IntegergetMaxInactiveInterval()HttpSessionContextgetSessionContext()ObjectgetAttribute(String name)ObjectgetValue(String name)Enumeration<String>getAttributeNames()Array<String>getValueNames()UnitsetAttribute(String name, Object value)UnitputValue(String name, Object value)UnitremoveAttribute(String name)UnitremoveValue(String name)final MockHttpSessioncopyAttributes(HttpSession httpSession)Unitinvalidate()BooleanisNew()StringtoString()-
-
Method Detail
-
getCreationTime
Long getCreationTime()
-
getLastAccessedTime
Long getLastAccessedTime()
-
getServletContext
ServletContext getServletContext()
-
setMaxInactiveInterval
Unit setMaxInactiveInterval(Integer interval)
-
getMaxInactiveInterval
Integer getMaxInactiveInterval()
-
getSessionContext
HttpSessionContext getSessionContext()
-
getAttribute
Object getAttribute(String name)
-
getAttributeNames
Enumeration<String> getAttributeNames()
-
getValueNames
Array<String> getValueNames()
-
setAttribute
Unit setAttribute(String name, Object value)
-
removeAttribute
Unit removeAttribute(String name)
-
removeValue
Unit removeValue(String name)
-
copyAttributes
final MockHttpSession copyAttributes(HttpSession httpSession)
-
invalidate
Unit invalidate()
-
-
-
-