Package com.helger.servlet.mock
Class MockHttpListener
- java.lang.Object
-
- com.helger.servlet.mock.MockHttpListener
-
@ThreadSafe public final class MockHttpListener extends Object
This class globally holds the HTTP listeners (ServletContextListener,HttpSessionListenerandServletRequestListener) that are triggered in tests.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddDefaultListener(EventListener aListener)static voidaddListener(EventListener aListener)static com.helger.commons.collection.impl.ICommonsList<jakarta.servlet.http.HttpSessionListener>getAllHttpSessionListeners()static com.helger.commons.collection.impl.ICommonsList<jakarta.servlet.ServletContextListener>getAllServletContextListeners()static com.helger.commons.collection.impl.ICommonsList<jakarta.servlet.ServletRequestListener>getAllServletRequestListeners()static voidremoveAllDefaultListeners()static voidremoveAllListeners()static voidremoveDefaultListeners(Class<? extends EventListener> aListenerClass)static voidremoveListeners(Class<? extends EventListener> aListenerClass)static voidsetCurrentToDefault()
-
-
-
Method Detail
-
addDefaultListener
public static void addDefaultListener(@Nonnull EventListener aListener)
-
removeDefaultListeners
public static void removeDefaultListeners(@Nonnull Class<? extends EventListener> aListenerClass)
-
removeAllDefaultListeners
public static void removeAllDefaultListeners()
-
setCurrentToDefault
public static void setCurrentToDefault()
-
addListener
public static void addListener(@Nonnull EventListener aListener)
-
removeListeners
public static void removeListeners(@Nonnull Class<? extends EventListener> aListenerClass)
-
removeAllListeners
public static void removeAllListeners()
-
getAllServletContextListeners
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<jakarta.servlet.ServletContextListener> getAllServletContextListeners()
-
getAllHttpSessionListeners
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<jakarta.servlet.http.HttpSessionListener> getAllHttpSessionListeners()
-
getAllServletRequestListeners
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<jakarta.servlet.ServletRequestListener> getAllServletRequestListeners()
-
-