XmlExtractor implements Extractor { @Override public RowReader getReader(Map<String, ?> parameters) { try { InputSource inputSource = new InputSource(connector.getInputStream(parameters)); NodeList nodes = (NodeList) expression.evaluate(inputSource, XPathConstants.NODESET); return new XmlRowReader(rowHeader, nodes); } catch (IOException | XPathExpressionException e) { throw new LmRuntimeException(e); } } XmlExtractor(StreamConnector connector, XmlRowAttribute[] rowHeader, XPathExpression expression); @Override RowReader getReader(Map<String, ?> parameters);  }
@Test public void testGetReader() throws Exception { RowReader reader = xmlExtractor.getReader(new HashMap<>()); verify(xPathExpressionMock).evaluate(argThat(new ArgumentMatcher<InputSource>() { @Override public boolean matches(Object argument) { return ((InputSource) argument).getByteStream() == inputStreamMock; } }), eq(XPathConstants.NODESET)); assertNotNull(reader); }