Class GraniteAssert
java.lang.Object
com.adobe.cq.testing.junit.assertion.GraniteAssert
Assertion utility methods for Granite integration testing.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertIsAgentEnabled
(CQClient client, String agentPath) Checks if an replication agent is enabled.static void
assertJsonEquals
(String jsonString1, String jsonString2) Compares two json strings for equality in terms of structure and data.static void
assertJsonEquals
(String jsonString1, String jsonString2, List<String> ignoreProperties) Compares two json strings for equality in terms of structure and data.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.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.static void
assertRegExFind
(String toValidate, String pattern) static void
assertRegExFind
(String message, String toValidate, String pattern) static void
assertRegExFind
(String message, String toValidate, Pattern pattern) static void
assertRegExFind
(String toValidate, Pattern pattern) static void
assertRegExMatch
(String toValidate, String pattern) static void
assertRegExMatch
(String message, String toValidate, String pattern) static void
assertRegExMatch
(String message, String toValidate, Pattern pattern) static void
assertRegExMatch
(String toValidate, Pattern pattern) static void
assertRegExNoFind
(String message, String toValidate, Pattern pattern) static void
assertRegExNoMatch
(String message, String toValidate, Pattern pattern) static void
assertStatusCode
(String message, org.apache.http.HttpResponse httpResponse, int statusCode) static void
assertStatusCode
(String message, org.apache.http.HttpResponse httpResponse, int[] statusCodes) static void
assertStatusCode
(org.apache.http.HttpResponse httpResponse, int statusCode) static void
assertStatusCode
(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
-