Package org.apache.sling.servlethelpers

# Class MockSlingHttpServletRequest

java.lang.Object
org.apache.felix.http.javaxwrappers.ServletRequestWrapper
org.apache.felix.http.javaxwrappers.HttpServletRequestWrapper
org.apache.sling.api.wrappers.JakartaToJavaxRequestWrapper
org.apache.sling.servlethelpers.MockSlingHttpServletRequest

All Implemented Interfaces:
  `javax.servlet.http.HttpServletRequest`, `javax.servlet.ServletRequest`, `org.apache.sling.api.adapter.Adaptable`, `org.apache.sling.api.SlingHttpServletRequest`

@ConsumerType @Deprecated(since="2.0.0") public class MockSlingHttpServletRequest extends org.apache.sling.api.wrappers.JakartaToJavaxRequestWrapper
Deprecated.
Use `MockSlingJakartaHttpServletRequest` instead.
Mock `SlingHttpServletRequest` implementation.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected static final ResourceBundle`
`EMPTY_RESOURCE_BUNDLE`
Deprecated.

### Fields inherited from interface javax.servlet.http.HttpServletRequest

`BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH`

## Constructor Summary

Constructors
Constructor
Description
`MockSlingHttpServletRequest(MockSlingJakartaHttpServletRequest wrappedRequest)`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`<T> T`
`adaptTo(Class<T> type)`
Deprecated.
`void`
`addCookie(javax.servlet.http.Cookie cookie)`
Deprecated.
`void`
`addDateHeader(String name, long date)`
Deprecated.
`void`
`addHeader(String name, String value)`
Deprecated.
`void`
`addIntHeader(String name, int value)`
Deprecated.
`void`
`addPart(javax.servlet.http.Part part)`
Deprecated.
`void`
`addRequestParameter(String name, byte[] content, String contentType)`
Deprecated.
`void`
`addRequestParameter(String name, byte[] content, String contentType, String filename)`
Deprecated.
`void`
`addRequestParameter(String name, String value)`
Deprecated.
`boolean`
`authenticate(javax.servlet.http.HttpServletResponse response)`
Deprecated.
`javax.servlet.RequestDispatcher`
`getRequestDispatcher(String path)`
Deprecated.
`javax.servlet.RequestDispatcher`
`getRequestDispatcher(String path, org.apache.sling.api.request.RequestDispatcherOptions options)`
Deprecated.
`javax.servlet.RequestDispatcher`
`getRequestDispatcher(org.apache.sling.api.resource.Resource resource)`
Deprecated.
`javax.servlet.RequestDispatcher`
`getRequestDispatcher(org.apache.sling.api.resource.Resource resource, org.apache.sling.api.request.RequestDispatcherOptions options)`
Deprecated.
`@NotNull org.apache.sling.api.request.RequestPathInfo`
`getRequestPathInfo()`
Deprecated.
`javax.servlet.http.HttpSession`
`getSession()`
Deprecated.
`javax.servlet.http.HttpSession`
`getSession(boolean create)`
Deprecated.
`protected MockHttpSession`
`newMockHttpSession()`
Deprecated.
`protected MockRequestPathInfo`
`newMockRequestPathInfo()`
Deprecated.
`void`
`setAuthType(String authType)`
Deprecated.
`void`
`setContent(byte[] content)`
Deprecated.
`void`
`setContentType(String type)`
Deprecated.
`void`
`setContextPath(String contextPath)`
Deprecated.
`void`
`setDateHeader(String name, long date)`
Deprecated.
`void`
`setHeader(String name, String value)`
Deprecated.
`void`
`setIntHeader(String name, int value)`
Deprecated.
`void`
`setLocale(Locale loc)`
Deprecated.
`void`
`setMethod(String method)`
Deprecated.
`void`
`setParameterMap(Map<String,Object> parameterMap)`
Deprecated.
`void`
`setPathInfo(String pathInfo)`
Deprecated.
`void`
`setQueryString(String queryString)`
Deprecated.
`void`
`setRemoteAddr(String remoteAddr)`
Deprecated.
`void`
`setRemoteHost(String remoteHost)`
Deprecated.
`void`
`setRemotePort(int remotePort)`
Deprecated.
`void`
`setRemoteUser(String remoteUser)`
Deprecated.
`void`
`setRequestDispatcherFactory(MockRequestDispatcherFactory requestDispatcherFactory)`
Deprecated.
`void`
`setResource(org.apache.sling.api.resource.Resource resource)`
Deprecated.
`void`
`setResponseContentType(String responseContentType)`
Deprecated.
`void`
`setScheme(String scheme)`
Deprecated.
`void`
`setServerName(String serverName)`
Deprecated.
`void`
`setServerPort(int serverPort)`
Deprecated.
`void`
`setServletPath(String servletPath)`
Deprecated.

### Methods inherited from class org.apache.sling.api.wrappers.JakartaToJavaxRequestWrapper

`getCookie, getRequestParameter, getRequestParameterList, getRequestParameterMap, getRequestParameters, getRequestProgressTracker, getResource, getResourceBundle, getResourceBundle, getResourceResolver, getResponseContentType, getResponseContentTypes, toJavaxRequest, toJavaxRequest, toJavaxRequest`

### Methods inherited from class org.apache.felix.http.javaxwrappers.HttpServletRequestWrapper

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

### Methods inherited from class org.apache.felix.http.javaxwrappers.ServletRequestWrapper

`getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getScheme, getServerName, getServerPort, getServletContext, getTranslatedAttributeName, getWrapper, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync`

### Methods inherited from class java.lang.Object

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

### Methods inherited from interface javax.servlet.http.HttpServletRequest

`changeSessionId, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getTrailerFields, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade`

### Methods inherited from interface javax.servlet.ServletRequest

`getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync`

### Methods inherited from interface org.apache.sling.api.SlingHttpServletRequest

`getAuthType, getRemoteUser, getUserPrincipal`

## Field Details

### EMPTY_RESOURCE_BUNDLE

protected static final ResourceBundle EMPTY_RESOURCE_BUNDLE
Deprecated.

## Constructor Details

### MockSlingHttpServletRequest

public MockSlingHttpServletRequest(MockSlingJakartaHttpServletRequest wrappedRequest)
Deprecated.

## Method Details

### newMockHttpSession

protected MockHttpSession newMockHttpSession()
Deprecated.

### newMockRequestPathInfo

protected MockRequestPathInfo newMockRequestPathInfo()
Deprecated.

### getSession

public javax.servlet.http.HttpSession getSession()
Deprecated.

Specified by:
  `getSession` in interface `javax.servlet.http.HttpServletRequest`
Overrides:
  `getSession` in class `org.apache.felix.http.javaxwrappers.HttpServletRequestWrapper`

### getSession

public javax.servlet.http.HttpSession getSession(boolean create)
Deprecated.

Specified by:
  `getSession` in interface `javax.servlet.http.HttpServletRequest`
Overrides:
  `getSession` in class `org.apache.felix.http.javaxwrappers.HttpServletRequestWrapper`

### setResource

public void setResource(org.apache.sling.api.resource.Resource resource)
Deprecated.

### setParameterMap

public void setParameterMap(Map<String,Object> parameterMap)
Deprecated.

### setLocale

public void setLocale(Locale loc)
Deprecated.

### setContextPath

public void setContextPath(String contextPath)
Deprecated.

### setQueryString

public void setQueryString(String queryString)
Deprecated.

### setScheme

public void setScheme(String scheme)
Deprecated.

### setServerName

public void setServerName(String serverName)
Deprecated.

### setServerPort

public void setServerPort(int serverPort)
Deprecated.

### setMethod

public void setMethod(String method)
Deprecated.

### addHeader

public void addHeader(String name, String value)
Deprecated.

### addIntHeader

public void addIntHeader(String name, int value)
Deprecated.

### addDateHeader

public void addDateHeader(String name, long date)
Deprecated.

### setHeader

public void setHeader(String name, String value)
Deprecated.

### setIntHeader

public void setIntHeader(String name, int value)
Deprecated.

### setDateHeader

public void setDateHeader(String name, long date)
Deprecated.

### addCookie

public void addCookie(javax.servlet.http.Cookie cookie)
Deprecated.

### addRequestParameter

public void addRequestParameter(String name, String value)
Deprecated.

### addRequestParameter

public void addRequestParameter(String name, byte[] content, String contentType)
Deprecated.

### addRequestParameter

public void addRequestParameter(String name, byte[] content, String contentType, String filename)
Deprecated.

### setContentType

public void setContentType(String type)
Deprecated.

### setContent

public void setContent(byte[] content)
Deprecated.

### setRequestDispatcherFactory

public void setRequestDispatcherFactory(MockRequestDispatcherFactory requestDispatcherFactory)
Deprecated.

### getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(String path)
Deprecated.

Specified by:
  `getRequestDispatcher` in interface `javax.servlet.ServletRequest`
Overrides:
  `getRequestDispatcher` in class `org.apache.felix.http.javaxwrappers.ServletRequestWrapper`

### getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(String path, org.apache.sling.api.request.RequestDispatcherOptions options)
Deprecated.

Specified by:
  `getRequestDispatcher` in interface `org.apache.sling.api.SlingHttpServletRequest`
Overrides:
  `getRequestDispatcher` in class `org.apache.sling.api.wrappers.JakartaToJavaxRequestWrapper`

### getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(org.apache.sling.api.resource.Resource resource)
Deprecated.

Specified by:
  `getRequestDispatcher` in interface `org.apache.sling.api.SlingHttpServletRequest`
Overrides:
  `getRequestDispatcher` in class `org.apache.sling.api.wrappers.JakartaToJavaxRequestWrapper`

### getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(org.apache.sling.api.resource.Resource resource, org.apache.sling.api.request.RequestDispatcherOptions options)
Deprecated.

Specified by:
  `getRequestDispatcher` in interface `org.apache.sling.api.SlingHttpServletRequest`
Overrides:
  `getRequestDispatcher` in class `org.apache.sling.api.wrappers.JakartaToJavaxRequestWrapper`

### setRemoteUser

public void setRemoteUser(String remoteUser)
Deprecated.

### setRemoteAddr

public void setRemoteAddr(String remoteAddr)
Deprecated.

### setRemoteHost

public void setRemoteHost(String remoteHost)
Deprecated.

### setRemotePort

public void setRemotePort(int remotePort)
Deprecated.

### setServletPath

public void setServletPath(String servletPath)
Deprecated.

### setPathInfo

public void setPathInfo(String pathInfo)
Deprecated.

### setAuthType

public void setAuthType(String authType)
Deprecated.

### setResponseContentType

public void setResponseContentType(String responseContentType)
Deprecated.

### addPart

public void addPart(javax.servlet.http.Part part)
Deprecated.

### authenticate

public boolean authenticate(javax.servlet.http.HttpServletResponse response)
Deprecated.

Specified by:
  `authenticate` in interface `javax.servlet.http.HttpServletRequest`
Overrides:
  `authenticate` in class `org.apache.felix.http.javaxwrappers.HttpServletRequestWrapper`

### getRequestPathInfo

@NotNull public @NotNull org.apache.sling.api.request.RequestPathInfo getRequestPathInfo()
Deprecated.

Specified by:
  `getRequestPathInfo` in interface `org.apache.sling.api.SlingHttpServletRequest`
Overrides:
  `getRequestPathInfo` in class `org.apache.sling.api.wrappers.JakartaToJavaxRequestWrapper`

### adaptTo

public <T> T adaptTo(Class<T> type)
Deprecated.

Specified by:
  `adaptTo` in interface `org.apache.sling.api.adapter.Adaptable`
Overrides:
  `adaptTo` in class `org.apache.sling.api.wrappers.JakartaToJavaxRequestWrapper`