public class MockHttpResponse extends Object implements HttpResponse
| Modifier and Type | Field and Description |
|---|---|
protected ByteArrayOutputStream |
baos |
protected String |
errorMessage |
protected List<javax.ws.rs.core.NewCookie> |
newCookies |
protected OutputStream |
os |
protected CaseInsensitiveMap |
outputHeaders |
protected boolean |
sentError |
protected int |
status |
| Constructor and Description |
|---|
MockHttpResponse() |
| Modifier and Type | Method and Description |
|---|---|
void |
addNewCookie(javax.ws.rs.core.NewCookie cookie) |
String |
getContentAsString() |
String |
getErrorMessage() |
List<javax.ws.rs.core.NewCookie> |
getNewCookies() |
byte[] |
getOutput() |
javax.ws.rs.core.MultivaluedMap<String,Object> |
getOutputHeaders() |
OutputStream |
getOutputStream() |
int |
getStatus() |
boolean |
isCommitted() |
boolean |
isErrorSent() |
void |
reset()
reset status and headers.
|
void |
sendError(int status) |
void |
sendError(int status,
String message) |
void |
setOutputStream(OutputStream os) |
void |
setStatus(int status) |
protected int status
protected ByteArrayOutputStream baos
protected OutputStream os
protected CaseInsensitiveMap outputHeaders
protected List<javax.ws.rs.core.NewCookie> newCookies
protected String errorMessage
protected boolean sentError
public int getStatus()
getStatus in interface HttpResponsepublic void setStatus(int status)
setStatus in interface HttpResponsepublic javax.ws.rs.core.MultivaluedMap<String,Object> getOutputHeaders()
getOutputHeaders in interface HttpResponsepublic OutputStream getOutputStream() throws IOException
getOutputStream in interface HttpResponseIOExceptionpublic void setOutputStream(OutputStream os)
setOutputStream in interface HttpResponsepublic byte[] getOutput()
public String getContentAsString()
public void addNewCookie(javax.ws.rs.core.NewCookie cookie)
addNewCookie in interface HttpResponsepublic void sendError(int status)
throws IOException
sendError in interface HttpResponseIOExceptionpublic void sendError(int status,
String message)
throws IOException
sendError in interface HttpResponseIOExceptionpublic List<javax.ws.rs.core.NewCookie> getNewCookies()
public String getErrorMessage()
public boolean isErrorSent()
public boolean isCommitted()
isCommitted in interface HttpResponsepublic void reset()
HttpResponsereset in interface HttpResponseCopyright © 2017 JBoss by Red Hat. All rights reserved.