Search in sources :

Example 1 with XmlToXPathsConverter

use of org.springframework.cloud.contract.verifier.util.xml.XmlToXPathsConverter in project spring-cloud-contract by spring-cloud.

the class XmlBodyVerificationBuilder method addXmlResponseBodyCheck.

void addXmlResponseBodyCheck(BlockBuilder blockBuilder, Object responseBody, BodyMatchers bodyMatchers, String responseString, boolean shouldCommentOutBDDBlocks) {
    addXmlProcessingLines(blockBuilder, responseString);
    Object processedBody = XmlToXPathsConverter.removeMatchingXPaths(responseBody, bodyMatchers);
    List<BodyMatcher> matchers = new XmlToXPathsConverter().mapToMatchers(processedBody);
    if (bodyMatchers != null && bodyMatchers.hasMatchers()) {
        matchers.addAll(bodyMatchers.matchers());
    }
    addBodyMatchingBlock(matchers, blockBuilder, responseBody, shouldCommentOutBDDBlocks);
}
Also used : XmlToXPathsConverter(org.springframework.cloud.contract.verifier.util.xml.XmlToXPathsConverter) BodyMatcher(org.springframework.cloud.contract.spec.internal.BodyMatcher)

Aggregations

BodyMatcher (org.springframework.cloud.contract.spec.internal.BodyMatcher)1 XmlToXPathsConverter (org.springframework.cloud.contract.verifier.util.xml.XmlToXPathsConverter)1