Class MockHttpSessionImpl
java.lang.Object
io.github.cdiunit.internal.servlet5.MockHttpSessionImpl
- All Implemented Interfaces:
jakarta.servlet.http.HttpSession
Shamlessly ripped from mockrunner.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttributeListener
(jakarta.servlet.http.HttpSessionAttributeListener listener) void
getAttribute
(String key) long
getId()
long
int
jakarta.servlet.ServletContext
jakarta.servlet.http.HttpSessionContext
String[]
void
boolean
isNew()
boolean
isValid()
void
void
removeAttribute
(String key) void
removeValue
(String key) void
resetAll()
Resets the state of this object to the default valuesvoid
setAttribute
(String key, Object value) void
setMaxInactiveInterval
(int maxInactiveInterval) void
setUpIsNew
(boolean isNew) void
setupServletContext
(jakarta.servlet.ServletContext servletContext) Set theServletContext
.
-
Constructor Details
-
MockHttpSessionImpl
public MockHttpSessionImpl(jakarta.servlet.ServletContext servletContext)
-
-
Method Details
-
resetAll
public void resetAll()Resets the state of this object to the default values -
addAttributeListener
public void addAttributeListener(jakarta.servlet.http.HttpSessionAttributeListener listener) -
setupServletContext
public void setupServletContext(jakarta.servlet.ServletContext servletContext) Set theServletContext
.- Parameters:
servletContext
- theServletContext
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()- Specified by:
getServletContext
in interfacejakarta.servlet.http.HttpSession
-
isValid
public boolean isValid() -
isNew
public boolean isNew()- Specified by:
isNew
in interfacejakarta.servlet.http.HttpSession
-
setUpIsNew
public void setUpIsNew(boolean isNew) -
getCreationTime
public long getCreationTime()- Specified by:
getCreationTime
in interfacejakarta.servlet.http.HttpSession
-
invalidate
public void invalidate()- Specified by:
invalidate
in interfacejakarta.servlet.http.HttpSession
-
getId
- Specified by:
getId
in interfacejakarta.servlet.http.HttpSession
-
getValue
- Specified by:
getValue
in interfacejakarta.servlet.http.HttpSession
-
getValueNames
- Specified by:
getValueNames
in interfacejakarta.servlet.http.HttpSession
-
putValue
- Specified by:
putValue
in interfacejakarta.servlet.http.HttpSession
-
removeValue
- Specified by:
removeValue
in interfacejakarta.servlet.http.HttpSession
-
clearAttributes
public void clearAttributes() -
getAttribute
- Specified by:
getAttribute
in interfacejakarta.servlet.http.HttpSession
-
getAttributeNames
- Specified by:
getAttributeNames
in interfacejakarta.servlet.http.HttpSession
-
removeAttribute
- Specified by:
removeAttribute
in interfacejakarta.servlet.http.HttpSession
-
setAttribute
- Specified by:
setAttribute
in interfacejakarta.servlet.http.HttpSession
-
getLastAccessedTime
public long getLastAccessedTime()- Specified by:
getLastAccessedTime
in interfacejakarta.servlet.http.HttpSession
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int maxInactiveInterval) - Specified by:
setMaxInactiveInterval
in interfacejakarta.servlet.http.HttpSession
-
getMaxInactiveInterval
public int getMaxInactiveInterval()- Specified by:
getMaxInactiveInterval
in interfacejakarta.servlet.http.HttpSession
-
getSessionContext
public jakarta.servlet.http.HttpSessionContext getSessionContext()- Specified by:
getSessionContext
in interfacejakarta.servlet.http.HttpSession
-