Class HelperApiUtil
- java.lang.Object
-
- io.virtualan.cucumblan.props.util.HelperApiUtil
-
public class HelperApiUtil extends Object
The type Helper util.
-
-
Constructor Summary
Constructors Constructor Description HelperApiUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertJSONObject(String resource, String jsonRequestExpected, String jsonRequestActual)Assert json object.static voidassertJsonpathEqual(List<String> jsonPath, String expectedjson, String actualjson)Assert jsonpath equal.static voidassertXMLEquals(String expectedXML, String actualXML)Assert xml equals.static voidassertXpathsEqual(List<String> xpaths, String expectedXML, String actualXML)Assert xpaths equal.static ObjectgetJSON(String jsonString, String path)Get json object.static ObjectgetORGJSONType(String jsonString, String path)Get json object.static StringreadFileAsString(String fileBody)Read file as string string.static voidverifyCSVSON(io.restassured.response.ValidatableResponse validatableResponse, String path, List<String> csvson, org.skyscreamer.jsonassert.JSONCompareMode mode, io.cucumber.java.Scenario scenario)Verify csvson.
-
-
-
Method Detail
-
readFileAsString
public static String readFileAsString(String fileBody)
Read file as string string.- Parameters:
fileBody- the file body- Returns:
- the string
-
assertXpathsEqual
public static void assertXpathsEqual(List<String> xpaths, String expectedXML, String actualXML) throws Exception
Assert xpaths equal.- Parameters:
xpaths- the xpathsexpectedXML- the expected xmlactualXML- the actual xml- Throws:
Exception- the exception
-
getJSON
public static Object getJSON(String jsonString, String path)
Get json object.- Parameters:
jsonString- the json stringpath- the path- Returns:
- the object
-
getORGJSONType
public static Object getORGJSONType(String jsonString, String path)
Get json object.- Parameters:
jsonString- the json stringpath- the path- Returns:
- the object
-
assertJSONObject
public static void assertJSONObject(String resource, String jsonRequestExpected, String jsonRequestActual)
Assert json object.- Parameters:
resource- the resourcejsonRequestExpected- the json request expectedjsonRequestActual- the json request actual
-
assertJsonpathEqual
public static void assertJsonpathEqual(List<String> jsonPath, String expectedjson, String actualjson)
Assert jsonpath equal.- Parameters:
jsonPath- the json pathexpectedjson- the expectedjsonactualjson- the actualjson
-
assertXMLEquals
public static void assertXMLEquals(String expectedXML, String actualXML) throws Exception
Assert xml equals.- Parameters:
expectedXML- the expected xmlactualXML- the actual xml- Throws:
Exception- the exception
-
verifyCSVSON
public static void verifyCSVSON(io.restassured.response.ValidatableResponse validatableResponse, String path, List<String> csvson, org.skyscreamer.jsonassert.JSONCompareMode mode, io.cucumber.java.Scenario scenario) throws ExceptionVerify csvson.- Parameters:
validatableResponse- the validatable responsepath- the pathcsvson- the csvsonmode- the modescenario- the scenario- Throws:
Exception- the exception
-
-