package company.specialsource.scraper; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.junit.jupiter.api.Test; import java.io.IOException; import java.io.InputStream; import static org.assertj.core.api.Assertions.assertThat; class DetailParserTest { private Document loadFixture(String fileName) throws IOException { try (InputStream in = getClass().getResourceAsStream("/scraper/" + fileName)) { assertThat(in).as("fixture %s must exist", fileName).isNotNull(); return Jsoup.parse(in, "UTF-8", "https://bbs.ruliweb.com/"); } } @Test void ruliwebPostDetailParser_extractsTextAndImages() throws IOException { Document doc = loadFixture("ruliweb_post_market.html"); PostDetail detail = new RuliwebPostDetailParser().parse(doc); assertThat(Jsoup.parse(detail.content()).text()).contains("핫딜관리자입니다"); assertThat(detail.content()).contains("