### Question:
BujintMojo extends AbstractMojo { String getImagePath(String str) throws Exception { DOMParser parser = new DOMParser(); parser.parse(new InputSource(new StringReader(str))); NodeList nodeList = XPathAPI.selectNodeList(parser.getDocument(), "/HTML/BODY/TABLE/TR/TH[1]/IMG"); String path = null; for (int i = 0; i < nodeList.getLength(); i++) { Element element = (Element) nodeList.item(i); path = element.getAttribute("src"); } return path; }  void execute();  }### Answer:
@Test public void testGetImagePath() throws Exception { InputStream is = getClass().getClassLoader().getResourceAsStream( "test.html"); String str = IOUtils.toString(is, "UTF-8"); BujintMojo target = new BujintMojo(); assertEquals("結果が不正です", "/jp/img/clk/6976221_31.jpg", target .getImagePath(str)); }