use of org.apache.nifi.processors.evtx.parser.bxml.ValueNode in project nifi by apache.
the class XmlBxmlNodeVisitorTest method testVisitValueNode.
@Test
public void testVisitValueNode() throws IOException {
ValueNode valueNode = mock(ValueNode.class);
BxmlNode child = mock(BxmlNode.class);
when(valueNode.getChildren()).thenReturn(Arrays.asList(child));
xmlBxmlNodeVisitor.visit(valueNode);
verify(child).accept(xmlBxmlNodeVisitor);
}
use of org.apache.nifi.processors.evtx.parser.bxml.ValueNode in project nifi by apache.
the class XmlBxmlNodeVisitorTest method testVisitAttributeNodeValueType.
@Test
public void testVisitAttributeNodeValueType() throws IOException, XMLStreamException {
String attributeName = "attributeName";
AttributeNode attributeNode = mock(AttributeNode.class);
ValueNode valueNode = mock(ValueNode.class);
BxmlNode child = mock(BxmlNode.class);
when(attributeNode.getAttributeName()).thenReturn(attributeName);
when(attributeNode.getValue()).thenReturn(valueNode);
when(valueNode.getChildren()).thenReturn(Arrays.asList(child));
doAnswer(invocation -> {
((BxmlNodeVisitor) invocation.getArguments()[0]).visit(valueNode);
return null;
}).when(valueNode).accept(any(BxmlNodeVisitor.class));
xmlBxmlNodeVisitor.visit(attributeNode);
verify(xmlStreamWriter).writeAttribute(attributeName, null);
verify(child).accept(any(BxmlNodeVisitor.class));
}
Aggregations