Class HelperApiUtil


  • public class HelperApiUtil
    extends Object
    The type Helper util.
    • Constructor Detail

      • HelperApiUtil

        public HelperApiUtil()
    • 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 xpaths
        expectedXML - the expected xml
        actualXML - the actual xml
        Throws:
        Exception - the exception
      • getJSON

        public static Object getJSON​(String jsonString,
                                     String path)
        Get json object.
        Parameters:
        jsonString - the json string
        path - the path
        Returns:
        the object
      • getORGJSONType

        public static Object getORGJSONType​(String jsonString,
                                            String path)
        Get json object.
        Parameters:
        jsonString - the json string
        path - the path
        Returns:
        the object
      • assertJSONObject

        public static void assertJSONObject​(String resource,
                                            String jsonRequestExpected,
                                            String jsonRequestActual)
        Assert json object.
        Parameters:
        resource - the resource
        jsonRequestExpected - the json request expected
        jsonRequestActual - the json request actual
      • assertJsonpathEqual

        public static void assertJsonpathEqual​(List<String> jsonPath,
                                               String expectedjson,
                                               String actualjson)
        Assert jsonpath equal.
        Parameters:
        jsonPath - the json path
        expectedjson - the expectedjson
        actualjson - the actualjson
      • assertXMLEquals

        public static void assertXMLEquals​(String expectedXML,
                                           String actualXML)
                                    throws Exception
        Assert xml equals.
        Parameters:
        expectedXML - the expected xml
        actualXML - 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 Exception
        Verify csvson.
        Parameters:
        validatableResponse - the validatable response
        path - the path
        csvson - the csvson
        mode - the mode
        scenario - the scenario
        Throws:
        Exception - the exception