public class MockedResponse extends Response
conn, content, isGzip, storeContent| Constructor and Description |
|---|
MockedResponse() |
MockedResponse(HttpURLConnection conn,
boolean isGzip,
boolean storeContent) |
| Modifier and Type | Method and Description |
|---|---|
static MockedResponse |
build() |
String |
content() |
Map<String,String> |
cookies() |
String |
error() |
String |
header(String key) |
Map<String,List<String>> |
headers() |
List<String> |
headers(String key) |
String |
location() |
int |
status() |
MockedResponse |
withContent(String content) |
MockedResponse |
withCookies(Map<String,String> cookies) |
MockedResponse |
withError(int status,
String error) |
MockedResponse |
withHeader(String key,
String value) |
MockedResponse |
withHeaders(Map<String,List<String>> headers) |
MockedResponse |
withHeaders(String key,
List<String> values) |
MockedResponse |
withStatus(int status) |
getConnection, isClientError, isInformational, isRedirection, isServerError, isSuccesspublic MockedResponse(HttpURLConnection conn, boolean isGzip, boolean storeContent)
public MockedResponse()
public static MockedResponse build()
public MockedResponse withContent(String content)
public String content() throws IOException
content in class ResponseIOExceptionpublic MockedResponse withStatus(int status)
public int status()
throws IOException
status in class ResponseIOExceptionpublic MockedResponse withError(int status, String error)
public String error() throws IOException
error in class ResponseIOExceptionpublic MockedResponse withCookies(Map<String,String> cookies)
public MockedResponse withHeaders(Map<String,List<String>> headers)
public MockedResponse withHeader(String key, String value)
public MockedResponse withHeaders(String key, List<String> values)
Copyright © 2018. All rights reserved.