From: Kai Moritz Date: Tue, 14 Jan 2020 12:34:41 +0000 (+0100) Subject: WIP:itflux X-Git-Tag: wip-it X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=450ea88ad63cb4f92b835fe77c1420005af0503b;p=demos%2Ftesting WIP:itflux --- diff --git a/pom.xml b/pom.xml index 6c5562e..0be8d19 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,7 @@ 1.8 + 1.12.1 5.8.1 1.12.4 @@ -54,8 +55,9 @@ test - io.projectreactor - reactor-test + org.jsoup + jsoup + ${jsoup.version} test diff --git a/src/test/java/de/juplo/demo/DemoApplicationIT.java b/src/test/java/de/juplo/demo/DemoApplicationIT.java index 1d8e7ac..131c52e 100644 --- a/src/test/java/de/juplo/demo/DemoApplicationIT.java +++ b/src/test/java/de/juplo/demo/DemoApplicationIT.java @@ -1,5 +1,8 @@ package de.juplo.demo; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; import org.junit.jupiter.api.Test; import static org.mockserver.matchers.Times.exactly; import static org.mockserver.model.HttpForward.forward; @@ -36,7 +39,13 @@ class DemoApplicationIT extends IntegrationTestBase .exchange() .expectStatus().isOk() .expectHeader().contentType(MediaType.TEXT_HTML) - .expectBody().xpath("/html/body/main/div/div").isEqualTo("Hello World!"); + .expectBody(String.class).value(rendered -> + { + Document doc = Jsoup.parse(rendered); + assertThat( + doc.select("html > body > main > div > div > pre").text()) + .isEqualTo("Hello World!"); + }); } @Configuration