Class FakeHttpServletRequest

java.lang.Object
jakarta.servlet.ServletRequestWrapper
jakarta.servlet.http.HttpServletRequestWrapper
org.gwizard.test.web.FakeHttpServletRequest
All Implemented Interfaces:
jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletRequest

public class FakeHttpServletRequest extends jakarta.servlet.http.HttpServletRequestWrapper
HttpServletRequest which implements only the attribute-related methods (and not even all of those). Suitable as a scope for framework bits that need such a thing. All methods except attribute-related methods will either do nothing or return null.
  • Field Summary

    Fields inherited from interface jakarta.servlet.http.HttpServletRequest

    BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     
     
    void
     
    void
    setAttribute(String key, Object value)
     

    Methods inherited from class jakarta.servlet.http.HttpServletRequestWrapper

    authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade

    Methods inherited from class jakarta.servlet.ServletRequestWrapper

    getAsyncContext, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterNames, getParameterValues, getProtocol, getProtocolRequestId, getReader, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getRequestId, getScheme, getServerName, getServerPort, getServletConnection, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, setCharacterEncoding, setRequest, startAsync, startAsync

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jakarta.servlet.ServletRequest

    getAsyncContext, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterNames, getParameterValues, getProtocol, getProtocolRequestId, getReader, getRemoteHost, getRemotePort, getRequestDispatcher, getRequestId, getScheme, getServerName, getServerPort, getServletConnection, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, setCharacterEncoding, startAsync, startAsync
  • Constructor Details

    • FakeHttpServletRequest

      public FakeHttpServletRequest()
  • Method Details

    • getAttribute

      public Object getAttribute(String key)
      Specified by:
      getAttribute in interface jakarta.servlet.ServletRequest
      Overrides:
      getAttribute in class jakarta.servlet.ServletRequestWrapper
    • setAttribute

      public void setAttribute(String key, Object value)
      Specified by:
      setAttribute in interface jakarta.servlet.ServletRequest
      Overrides:
      setAttribute in class jakarta.servlet.ServletRequestWrapper
    • removeAttribute

      public void removeAttribute(String key)
      Specified by:
      removeAttribute in interface jakarta.servlet.ServletRequest
      Overrides:
      removeAttribute in class jakarta.servlet.ServletRequestWrapper
    • getRemoteAddr

      public String getRemoteAddr()
      Specified by:
      getRemoteAddr in interface jakarta.servlet.ServletRequest
      Overrides:
      getRemoteAddr in class jakarta.servlet.ServletRequestWrapper
    • getHeaderNames

      public Enumeration<String> getHeaderNames()
      Specified by:
      getHeaderNames in interface jakarta.servlet.http.HttpServletRequest
      Overrides:
      getHeaderNames in class jakarta.servlet.http.HttpServletRequestWrapper
    • getParameterMap

      public Map<String,String[]> getParameterMap()
      Specified by:
      getParameterMap in interface jakarta.servlet.ServletRequest
      Overrides:
      getParameterMap in class jakarta.servlet.ServletRequestWrapper