@BeforeMethod public void setUp() throws SaxonApiException { MockitoAnnotations.initMocks(this); given(processorFactory.createProcessor()).willReturn(processor); given(processor.newXQueryCompiler()).willReturn(xQueryCompiler); given(xQueryCompiler.compile(QUERY)).willReturn(xQueryExecutable); given(xQueryExecutable.load()).willReturn(xQueryEvaluator); given(inputSourceFactory.createInputSource(INPUT)).willReturn(inputSource); given(saxSourceFactory.createSAXSource(inputSource)).willReturn(saxSource); given(byteArrayOutputStreamFactory.createByteArrayOutputStream()).willReturn(outputStream); }
private void setTemplateMocks() throws SaxonApiException { given(inputSourceFactory.createInputSource(templateInputStream)).willReturn(inputSource); given(saxSourceFactory.createSAXSource(xmlReader, inputSource)).willReturn(templateSource); given(processor.newDocumentBuilder().build(templateSource)).willReturn(templateNode); }