Skip to content

Commit 94c315c

Browse files
committed
Refactor JsoupParserTest
1 parent 4772976 commit 94c315c

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎jsoup/src/test/java/com/baeldung/jsoup/JsoupParserTest.java‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
package com.baeldung.jsoup;
22

3-
import java.io.IOException;
43
import org.jsoup.HttpStatusException;
54
import org.jsoup.Jsoup;
65
import org.jsoup.nodes.Document;
76
import org.jsoup.nodes.Element;
87
import org.jsoup.parser.Tag;
98
import org.jsoup.select.Elements;
10-
import static org.junit.Assert.assertEquals;
11-
import static org.junit.Assert.assertTrue;
129
import org.junit.Before;
1310
import org.junit.Test;
1411

12+
import java.io.IOException;
13+
14+
import static org.junit.Assert.assertEquals;
15+
import static org.junit.Assert.assertTrue;
16+
1517
public class JsoupParserTest {
1618

1719
Document doc;
@@ -70,7 +72,7 @@ public void examplesTraversing() {
7072
Elements children = firstSection.children();
7173
Elements siblings = firstSection.siblingElements();
7274

73-
sections.stream().forEach(el -> System.out.println("section: " + el));
75+
sections.forEach(el -> System.out.println("section: " + el));
7476
}
7577

7678
@Test
@@ -96,9 +98,9 @@ public void examplesModifying() {
9698
firstArticle.select("h2").html("<div><span></span></div>");
9799

98100
Element link = new Element(Tag.valueOf("a"), "")
99-
.text("Checkout this amazing website!")
100-
.attr("href", "http://baeldung.com")
101-
.attr("target", "_blank");
101+
.text("Checkout this amazing website!")
102+
.attr("href", "http://baeldung.com")
103+
.attr("target", "_blank");
102104
firstArticle.appendChild(link);
103105

104106
doc.select("li.navbar-link").remove();

0 commit comments

Comments
 (0)