Class GraniteAssert
java.lang.Object
com.adobe.cq.testing.junit.assertion.GraniteAssert
Assertion utility methods for Granite integration testing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertIsAgentEnabled(CQClient client, String agentPath) Checks if an replication agent is enabled.static voidassertJsonEquals(String jsonString1, String jsonString2) Compares two json strings for equality in terms of structure and data.static voidassertJsonEquals(String jsonString1, String jsonString2, List<String> ignoreProperties) Compares two json strings for equality in terms of structure and data.static voidassertJsonEquals(String jsonStringExpected, String jsonStringActual, List<String> ignoreProperties, List<String> ignoreNodes) Compares two json strings for equality in terms of structure and data.static voidassertJsonEquals(String jsonStringExpected, String jsonStringActual, List<String> ignoreProperties, List<String> ignoreNodes, boolean ignoreOrderOfProperties) Compares two json strings for equality in terms of structure and data.static voidassertRegExFind(String toValidate, String pattern) static voidassertRegExFind(String message, String toValidate, String pattern) static voidassertRegExFind(String message, String toValidate, Pattern pattern) static voidassertRegExFind(String toValidate, Pattern pattern) static voidassertRegExMatch(String toValidate, String pattern) static voidassertRegExMatch(String message, String toValidate, String pattern) static voidassertRegExMatch(String message, String toValidate, Pattern pattern) static voidassertRegExMatch(String toValidate, Pattern pattern) static voidassertRegExNoFind(String message, String toValidate, Pattern pattern) static voidassertRegExNoMatch(String message, String toValidate, Pattern pattern) static voidassertStatusCode(String message, org.apache.http.HttpResponse httpResponse, int statusCode) static voidassertStatusCode(String message, org.apache.http.HttpResponse httpResponse, int[] statusCodes) static voidassertStatusCode(org.apache.http.HttpResponse httpResponse, int statusCode) static voidassertStatusCode(org.apache.http.HttpResponse httpResponse, int[] statusCodes)
-
Constructor Details
-
GraniteAssert
public GraniteAssert()
-
-
Method Details
-
assertRegExMatch
-
assertRegExMatch
-
assertRegExMatch
-
assertRegExMatch
-
assertRegExNoMatch
-
assertRegExFind
-
assertRegExFind
-
assertRegExFind
-
assertRegExFind
-
assertRegExNoFind
-
assertStatusCode
public static void assertStatusCode(org.apache.http.HttpResponse httpResponse, int statusCode) -
assertStatusCode
public static void assertStatusCode(String message, org.apache.http.HttpResponse httpResponse, int statusCode) -
assertStatusCode
public static void assertStatusCode(org.apache.http.HttpResponse httpResponse, int[] statusCodes) -
assertStatusCode
public static void assertStatusCode(String message, org.apache.http.HttpResponse httpResponse, int[] statusCodes) -
assertJsonEquals
public static void assertJsonEquals(String jsonString1, String jsonString2, List<String> ignoreProperties) Compares two json strings for equality in terms of structure and data.There are some properties, like the lastModified property, that make it hard to compare against a reference. In this case you can feed in a list of of such properties, and they are ignored during comparison.
- Parameters:
jsonString1- expectedjsonString2- actualignoreProperties- properties to be ignored
-
assertJsonEquals
public static void assertJsonEquals(String jsonStringExpected, String jsonStringActual, List<String> ignoreProperties, List<String> ignoreNodes) Compares two json strings for equality in terms of structure and data. By default order of properties will be not taken in account.There are some properties, like the lastModified property, that make it hard to compare against a reference. In this case you can feed in a list of of such properties, and they are ignored during comparison.
- Parameters:
jsonStringExpected- expectedjsonStringActual- actualignoreProperties- properties to be ignoredignoreNodes- nodes to be ignored
-
assertJsonEquals
public static void assertJsonEquals(String jsonStringExpected, String jsonStringActual, List<String> ignoreProperties, List<String> ignoreNodes, boolean ignoreOrderOfProperties) Compares two json strings for equality in terms of structure and data.There are some properties, like the lastModified property, that make it hard to compare against a reference. In this case you can feed in a list of of such properties, and they are ignored during comparison.
- Parameters:
jsonStringExpected- expectedjsonStringActual- actualignoreProperties- properties to be ignoredignoreNodes- nodes to be ignoredignoreOrderOfProperties- ignore the order of properties
-
assertJsonEquals
Compares two json strings for equality in terms of structure and data.- Parameters:
jsonString1- first stringjsonString2- second string
-
assertIsAgentEnabled
Checks if an replication agent is enabled. Asserts if its not the case.- Parameters:
client- The client used for verificationagentPath- The path to the agent
-