@Test
public void testImgUrlExtraction() throws Exception {

    final String test = "<html><head><title>Title</title>" +
            "<base href=\"http://domain.com\" />" +
            "</head><body><img src=\"image.jpg\" /></body></html>";
    StringWriter sw = new StringWriter();
    new HtmlParser().parse(
            new ByteArrayInputStream(test.getBytes(UTF_8)),
            makeHtmlTransformer(sw), new Metadata(), new ParseContext());
    String result = sw.toString();
    // <img> tag should exist, with fully resolved URL
    assertTrue(Pattern.matches("(?s).*src=\"http://domain.com/image.jpg\".*$", result));
}