public abstract class AbstractTest extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractTest.Service |
| Modifier and Type | Field and Description |
|---|---|
protected static String |
JSON_ACCESS |
protected static String |
JSON_TOKEN |
protected okhttp3.mockwebserver.MockWebServer |
server |
| Constructor and Description |
|---|
AbstractTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterTest() |
protected void |
associateClient(OSClient os) |
protected String |
authURL(String path) |
protected OSClient |
os() |
protected OSClient |
osv3() |
protected void |
respondWith(int statusCode)
Responds with specified status code and no body
|
protected void |
respondWith(int statusCode,
String jsonBody)
Responds with specified status code and json body
|
protected void |
respondWith(Map<String,String> headers,
int statusCode)
Responds with specified status code, no body and optional headers
|
protected void |
respondWith(Map<String,String> headers,
int statusCode,
String body)
Responds with specified status code, body and optional headers
|
protected void |
respondWith(String resource)
Responds with success status code and body from json resource file
|
protected void |
respondWithCodeAndResource(int statusCode,
String resource) |
protected void |
respondWithHeaderAndResource(Map<String,String> headers,
int statusCode,
String resource)
Responds with given header, status code, body from json resource file
|
protected abstract AbstractTest.Service |
service() |
protected void |
startServer() |
protected static final String JSON_ACCESS
protected static final String JSON_TOKEN
protected okhttp3.mockwebserver.MockWebServer server
protected abstract AbstractTest.Service service()
protected void startServer()
throws UnknownHostException
UnknownHostExceptionprotected void respondWith(String resource) throws IOException
resource - the json resource fileIOException - Signals that an I/O exception has occurred.protected void respondWith(int statusCode)
statusCode - the status code to respond withprotected void respondWith(Map<String,String> headers, int statusCode)
headers - optional headersstatusCode - the status code to respond withprotected void respondWith(int statusCode,
String jsonBody)
statusCode - the status code to respond withbody - the json bodyprotected void respondWith(Map<String,String> headers, int statusCode, String body)
headers - optional headersstatusCode - the status code to respond withbody - the response bodyprotected void respondWithHeaderAndResource(Map<String,String> headers, int statusCode, String resource) throws IOException
headers - the specified headerstatusCode - the status code to respond withresource - the json resource fileIOException - Signals that an I/O exception has occurredprotected void respondWithCodeAndResource(int statusCode,
String resource)
throws IOException
IOExceptionprotected void afterTest()
protected void associateClient(OSClient os)
protected OSClient os()
protected OSClient osv3()
Copyright © 2016. All Rights Reserved.