Search in sources :

Example 1 with XMLAssertion

use of io.restassured.assertion.XMLAssertion in project rest-assured by rest-assured.

the class XmlPath method getFromPath.

private <T> T getFromPath(String path, boolean convertToJavaObject) {
    final GPathResult input = lazyXmlParser.invoke();
    final XMLAssertion xmlAssertion = new XMLAssertion();
    if (params != null) {
        xmlAssertion.setParams(params);
    }
    final String root = rootPath.equals("") ? rootPath : rootPath.endsWith(".") ? rootPath : rootPath + ".";
    xmlAssertion.setKey(root + path);
    return (T) xmlAssertion.getResult(input, convertToJavaObject, true);
}
Also used : XMLAssertion(io.restassured.assertion.XMLAssertion) GPathResult(groovy.util.slurpersupport.GPathResult)

Aggregations

GPathResult (groovy.util.slurpersupport.GPathResult)1 XMLAssertion (io.restassured.assertion.XMLAssertion)1