public class MockHttpRequest extends Object implements HttpRequest
| Modifier and Type | Field and Description |
|---|---|
protected ResteasyAsynchronousContext |
asynchronousContext |
protected Map<String,Object> |
attributes |
protected MultivaluedMap<String,String> |
decodedFormParameters |
protected static URI |
EMPTY_URI |
protected MultivaluedMap<String,String> |
formParameters |
protected ResteasyHttpHeaders |
httpHeaders |
protected String |
httpMethod |
protected InputStream |
inputStream |
protected ResteasyUriInfo |
uri |
| Modifier | Constructor and Description |
|---|---|
protected |
MockHttpRequest() |
protected ResteasyHttpHeaders httpHeaders
protected InputStream inputStream
protected ResteasyUriInfo uri
protected String httpMethod
protected MultivaluedMap<String,String> formParameters
protected MultivaluedMap<String,String> decodedFormParameters
protected ResteasyAsynchronousContext asynchronousContext
protected static final URI EMPTY_URI
protected static MockHttpRequest initWithUri(String uri) throws URISyntaxException
URISyntaxExceptionpublic static MockHttpRequest create(String httpMethod, String uri) throws URISyntaxException
URISyntaxExceptionpublic static MockHttpRequest create(String httpMethod, URI uriObj, URI baseUri)
public static MockHttpRequest options(String uri) throws URISyntaxException
URISyntaxExceptionpublic static MockHttpRequest get(String uri) throws URISyntaxException
URISyntaxExceptionpublic static MockHttpRequest post(String uri) throws URISyntaxException
URISyntaxExceptionpublic static MockHttpRequest put(String uri) throws URISyntaxException
URISyntaxExceptionpublic static MockHttpRequest delete(String uri) throws URISyntaxException
URISyntaxExceptionpublic static MockHttpRequest head(String uri) throws URISyntaxException
URISyntaxExceptionpublic static MockHttpRequest deepCopy(HttpRequest request) throws IOException
IOExceptionpublic void setHttpMethod(String method)
setHttpMethod in interface HttpRequestpublic ResteasyAsynchronousContext getAsynchronousContext()
public void setAsynchronousContext(ResteasyAsynchronousContext asynchronousContext)
public MockHttpRequest header(String name, String value)
public MockHttpRequest accept(List<MediaType> accepts)
public MockHttpRequest accept(MediaType accept)
public MockHttpRequest accept(String type)
public MockHttpRequest language(String language)
public MockHttpRequest cookie(String name, String value)
public MockHttpRequest contentType(String type)
public MockHttpRequest contentType(MediaType type)
public MockHttpRequest content(byte[] bytes)
public MockHttpRequest content(InputStream stream)
public MockHttpRequest addFormHeader(String name, String value)
name - value - public HttpHeaders getHttpHeaders()
getHttpHeaders in interface HttpRequestpublic MultivaluedMap<String,String> getMutableHeaders()
getMutableHeaders in interface HttpRequestpublic InputStream getInputStream()
getInputStream in interface HttpRequestpublic void setInputStream(InputStream stream)
HttpRequestsetInputStream in interface HttpRequestpublic ResteasyUriInfo getUri()
getUri in interface HttpRequestpublic String getHttpMethod()
getHttpMethod in interface HttpRequestpublic MultivaluedMap<String,String> getFormParameters()
HttpRequestgetFormParameters in interface HttpRequestpublic MultivaluedMap<String,String> getDecodedFormParameters()
getDecodedFormParameters in interface HttpRequestpublic void setRequestUri(URI requestUri) throws IllegalStateException
setRequestUri in interface HttpRequestIllegalStateExceptionpublic void setRequestUri(URI baseUri, URI requestUri) throws IllegalStateException
setRequestUri in interface HttpRequestIllegalStateExceptionpublic boolean isInitial()
isInitial in interface HttpRequestpublic void initialRequestThreadFinished()
public Object getAttribute(String attribute)
HttpRequestgetAttribute in interface HttpRequestpublic void setAttribute(String name, Object value)
setAttribute in interface HttpRequestpublic void removeAttribute(String name)
removeAttribute in interface HttpRequestpublic Enumeration<String> getAttributeNames()
getAttributeNames in interface HttpRequestpublic ResteasyAsynchronousContext getAsyncContext()
getAsyncContext in interface HttpRequestpublic void forward(String path)
forward in interface HttpRequestpublic boolean wasForwarded()
wasForwarded in interface HttpRequestCopyright © 2013. All Rights Reserved.