public class AssertUtils extends Object
| Constructor and Description |
|---|
AssertUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertContains(String needle,
String haystack) |
static void |
assertContainsNot(String needle,
String haystack) |
static String |
assertStatusCode(int expectedHttpStatusCode,
org.apache.http.client.methods.HttpUriRequest request) |
static void |
closeConnections() |
static void |
disableHTTPAuthentication() |
static String |
getAndAssert(int expectedHttpStatusCode,
String url) |
static String |
getAndAssert(int expectedHttpStatusCode,
String url,
String[] header) |
static String |
getAndAssert200(String url) |
static String |
getAndAssert200(String url,
String[] header) |
static String |
postAndAssert(int expectedHttpStatusCode,
String url,
String body) |
static String |
postAndAssert(int expectedHttpStatusCode,
String url,
String[] headers,
String body) |
static String |
postAndAssert200(String url,
String body) |
static void |
replaceInFile(File file,
String from,
String to_) |
static void |
setupHTTPAuthentication(String host,
int port,
String user,
String pass) |
static void |
trustAnyHTTPSServer(int port) |
public static String getAndAssert200(String url) throws org.apache.http.ParseException, IOException
org.apache.http.ParseExceptionIOExceptionpublic static String getAndAssert200(String url, String[] header) throws org.apache.http.ParseException, IOException
org.apache.http.ParseExceptionIOExceptionpublic static String getAndAssert(int expectedHttpStatusCode, String url) throws org.apache.http.ParseException, IOException
org.apache.http.ParseExceptionIOExceptionpublic static String getAndAssert(int expectedHttpStatusCode, String url, String[] header) throws org.apache.http.ParseException, IOException
org.apache.http.ParseExceptionIOExceptionpublic static String postAndAssert200(String url, String body) throws org.apache.http.client.ClientProtocolException, IOException
org.apache.http.client.ClientProtocolExceptionIOExceptionpublic static String assertStatusCode(int expectedHttpStatusCode, org.apache.http.client.methods.HttpUriRequest request) throws org.apache.http.client.ClientProtocolException, IOException
org.apache.http.client.ClientProtocolExceptionIOExceptionpublic static String postAndAssert(int expectedHttpStatusCode, String url, String body) throws org.apache.http.client.ClientProtocolException, IOException
org.apache.http.client.ClientProtocolExceptionIOExceptionpublic static String postAndAssert(int expectedHttpStatusCode, String url, String[] headers, String body) throws org.apache.http.client.ClientProtocolException, IOException
org.apache.http.client.ClientProtocolExceptionIOExceptionpublic static void disableHTTPAuthentication()
public static void setupHTTPAuthentication(String host, int port, String user, String pass)
public static void trustAnyHTTPSServer(int port)
throws NoSuchAlgorithmException,
KeyManagementException
public static void replaceInFile(File file, String from, String to_) throws IOException
IOExceptionpublic static void closeConnections()
Copyright © 2019. All Rights Reserved.