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
URISyntaxException
public static MockHttpRequest create(String httpMethod, String uri) throws URISyntaxException
URISyntaxException
public static MockHttpRequest create(String httpMethod, URI uriObj, URI baseUri)
public static MockHttpRequest options(String uri) throws URISyntaxException
URISyntaxException
public static MockHttpRequest get(String uri) throws URISyntaxException
URISyntaxException
public static MockHttpRequest post(String uri) throws URISyntaxException
URISyntaxException
public static MockHttpRequest put(String uri) throws URISyntaxException
URISyntaxException
public static MockHttpRequest delete(String uri) throws URISyntaxException
URISyntaxException
public static MockHttpRequest head(String uri) throws URISyntaxException
URISyntaxException
public static MockHttpRequest deepCopy(HttpRequest request) throws IOException
IOException
public void setHttpMethod(String method)
setHttpMethod
in interface HttpRequest
public 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 HttpRequest
public MultivaluedMap<String,String> getMutableHeaders()
getMutableHeaders
in interface HttpRequest
public InputStream getInputStream()
getInputStream
in interface HttpRequest
public void setInputStream(InputStream stream)
HttpRequest
setInputStream
in interface HttpRequest
public ResteasyUriInfo getUri()
getUri
in interface HttpRequest
public String getHttpMethod()
getHttpMethod
in interface HttpRequest
public MultivaluedMap<String,String> getFormParameters()
HttpRequest
getFormParameters
in interface HttpRequest
public MultivaluedMap<String,String> getDecodedFormParameters()
getDecodedFormParameters
in interface HttpRequest
public void setRequestUri(URI requestUri) throws IllegalStateException
setRequestUri
in interface HttpRequest
IllegalStateException
public void setRequestUri(URI baseUri, URI requestUri) throws IllegalStateException
setRequestUri
in interface HttpRequest
IllegalStateException
public boolean isInitial()
isInitial
in interface HttpRequest
public void initialRequestThreadFinished()
public Object getAttribute(String attribute)
HttpRequest
getAttribute
in interface HttpRequest
public void setAttribute(String name, Object value)
setAttribute
in interface HttpRequest
public void removeAttribute(String name)
removeAttribute
in interface HttpRequest
public Enumeration<String> getAttributeNames()
getAttributeNames
in interface HttpRequest
public ResteasyAsynchronousContext getAsyncContext()
getAsyncContext
in interface HttpRequest
public void forward(String path)
forward
in interface HttpRequest
public boolean wasForwarded()
wasForwarded
in interface HttpRequest
Copyright © 2013. All Rights Reserved.