ReverseProxyRewritingContext rewritingContext =
new DefaultReverseProxyRewritingContext(proxyPathMapperProvider.findMapper("/www_apache/index.html"),
proxyPathMapperProvider,
"/webcontent/rproxy");
DefaultReverseProxyLinkRewritingParserAdaptor parserAdaptor = new DefaultReverseProxyLinkRewritingParserAdaptor();
parserAdaptor.setReverseProxyRewritingContext(rewritingContext);
parserAdaptor.setLookUpAllMappings(false);
BeanUtils.setProperty(parserAdaptor, "lookUpAllMappings", new String [] { "true" });
assertTrue(parserAdaptor.getLookUpAllMappings());
BeanUtils.setProperty(parserAdaptor, "customPatterns", new String [] { "\\/lazyLoader" });
BeanUtils.setProperty(parserAdaptor, "customReplaces", new String [] { "/busyLoader" });
StringReader reader = new StringReader(html);
StringWriter writer = new StringWriter();
parserAdaptor.rewrite(null, reader, writer);
log.info("source: \n" + html);
log.info("result: \n" + writer);
List<String> lines = (List<String>) IOUtils.readLines(new StringReader(writer.toString()));