use of com.predic8.membrane.core.interceptor.xmlcontentfilter.XMLContentFilter in project service-proxy by membrane.
the class ReassembleTest method testXMLContentFilter.
private void testXMLContentFilter(String xpath, int expectedNumberOfRemainingElements) throws IOException, XPathExpressionException {
XMLContentFilter cf = new XMLContentFilter(xpath);
Message m = getResponse();
cf.removeMatchingElements(m);
Assert.assertEquals("text/xml", m.getHeader().getContentType());
Assert.assertEquals(expectedNumberOfRemainingElements + 1, StringUtils.countMatches(m.getBody().toString(), "<"));
}
use of com.predic8.membrane.core.interceptor.xmlcontentfilter.XMLContentFilter in project service-proxy by membrane.
the class XMLContentFilterTest method applyXPath.
private String applyXPath(String xpath) throws XPathExpressionException {
Message m = getMessage();
new XMLContentFilter(xpath).removeMatchingElements(m);
return m.getBody().toString();
}
Aggregations