public class MockHttpRequest extends Object implements HttpRequest
Constructor and Description |
---|
MockHttpRequest() |
Modifier and Type | Method and Description |
---|---|
String |
getHeader(String name)
Get the named HTTP request header.
|
String |
getParameter(String name)
Get the named HTTP request parameter from the request query string.
|
Enumeration |
getParameterNames()
Returns an Enumeration of String objects containing the names of the
parameters contained in this request.
|
String[] |
getParameterValues(String name)
Returns an array of String objects containing all of the values the given
request parameter has, or null if the parameter does not exist.
|
void |
reset() |
void |
setHeader(String header,
String value) |
void |
setParameter(String parameter,
String value) |
public String getHeader(String name)
HttpRequest
getHeader
in interface HttpRequest
name
- The request header name.public String getParameter(String name)
HttpRequest
getParameter
in interface HttpRequest
name
- The name of the required request parameter.public Enumeration getParameterNames()
HttpRequest
getParameterNames
in interface HttpRequest
public String[] getParameterValues(String name)
HttpRequest
getParameterValues
in interface HttpRequest
name
- String containing the name of the parameter whose value is
requested.public void reset()
Copyright © 2020. All rights reserved.