use of org.apache.nifi.processors.evtx.parser.bxml.OpenStartElementNode in project nifi by apache.
the class XmlBxmlNodeVisitorTest method testVisitOpenStartElementNode.
@Test
public void testVisitOpenStartElementNode() throws IOException, XMLStreamException {
String tagName = "open";
OpenStartElementNode openStartElementNode = mock(OpenStartElementNode.class);
AttributeNode attributeNode = mock(AttributeNode.class);
AttributeNode attributeNode2 = mock(AttributeNode.class);
BxmlNode bxmlNode = mock(BxmlNode.class);
when(openStartElementNode.getTagName()).thenReturn(tagName);
when(openStartElementNode.getChildren()).thenReturn(Arrays.asList(attributeNode, bxmlNode, attributeNode2));
xmlBxmlNodeVisitor.visit(openStartElementNode);
InOrder inOrder = inOrder(xmlStreamWriter, attributeNode, attributeNode2, bxmlNode);
inOrder.verify(xmlStreamWriter).writeStartElement(tagName);
inOrder.verify(attributeNode).accept(xmlBxmlNodeVisitor);
inOrder.verify(attributeNode2).accept(xmlBxmlNodeVisitor);
inOrder.verify(bxmlNode).accept(xmlBxmlNodeVisitor);
inOrder.verify(xmlStreamWriter).writeEndElement();
}
Aggregations