use of org.xmlunit.util.Predicate in project spring-framework by spring-projects.
the class XMLEventStreamReaderTests method readCorrect.
@Test
public void readCorrect() throws Exception {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
StAXSource source = new StAXSource(streamReader);
StringWriter writer = new StringWriter();
transformer.transform(source, new StreamResult(writer));
Predicate<Node> nodeFilter = n -> n.getNodeType() != Node.DOCUMENT_TYPE_NODE && n.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE;
assertThat(writer.toString(), isSimilarTo(XML).withNodeFilter(nodeFilter));
}
Aggregations