use of org.jdom2.xpath.XPath in project qpp-conversion-tool by CMSgov.
the class JsonPathToXpathHelper method executeAttributeTest.
public void executeAttributeTest(String jsonPath, String expectedValue) {
String xPath = PathCorrelator.prepPath(jsonPath, wrapper);
Attribute attribute = null;
try {
attribute = evaluateXpath(xPath, Filters.attribute());
} catch (XmlException e) {
fail(e.getMessage());
}
if (CHECK_FOR_NULL_SET.stream().anyMatch(jsonPath::matches)) {
assertThat(attribute.getValue()).isNotNull();
} else {
assertWithMessage("( %s ) value ( %s ) does not equal ( %s ) at \n( %s ). \nPlease investigate.", jsonPath, expectedValue, attribute.getValue(), xPath).that(attribute.getValue()).isEqualTo(expectedValue);
}
}
use of org.jdom2.xpath.XPath in project qpp-conversion-tool by CMSgov.
the class JsonPathToXpathHelper method executeElementTest.
public void executeElementTest(String jsonPath, String xmlElementName) throws XmlException {
String xPath = PathCorrelator.prepPath(jsonPath, wrapper);
Element element = evaluateXpath(xPath, Filters.element());
assertThat(xmlElementName).isEqualTo(element.getName());
}
Aggregations