diff --git a/webmagic-core/src/test/java/us/codecraft/webmagic/HtmlTest.java b/webmagic-core/src/test/java/us/codecraft/webmagic/HtmlTest.java index ac2e9b11..a9e2c471 100644 --- a/webmagic-core/src/test/java/us/codecraft/webmagic/HtmlTest.java +++ b/webmagic-core/src/test/java/us/codecraft/webmagic/HtmlTest.java @@ -39,7 +39,7 @@ public class HtmlTest { assertThat(html.links().all()).contains("/xx/xx"); } - @Test + @Test(expected = NullPointerException) public void testNthNodesGet(){ Html html = new Html("xx"); assertThat(html.xpath("//a[1]/@href").get()).isEqualTo("/xx/xx");