Search in sources :

Example 1 with OpenStartElementNode

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();
}
Also used : AttributeNode(org.apache.nifi.processors.evtx.parser.bxml.AttributeNode) InOrder(org.mockito.InOrder) OpenStartElementNode(org.apache.nifi.processors.evtx.parser.bxml.OpenStartElementNode) BxmlNode(org.apache.nifi.processors.evtx.parser.bxml.BxmlNode) Test(org.junit.Test)

Aggregations

AttributeNode (org.apache.nifi.processors.evtx.parser.bxml.AttributeNode)1 BxmlNode (org.apache.nifi.processors.evtx.parser.bxml.BxmlNode)1 OpenStartElementNode (org.apache.nifi.processors.evtx.parser.bxml.OpenStartElementNode)1 Test (org.junit.Test)1 InOrder (org.mockito.InOrder)1