From 450ea88ad63cb4f92b835fe77c1420005af0503b Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 14 Jan 2020 13:34:41 +0100 Subject: [PATCH] WIP:itflux --- pom.xml | 6 ++++-- src/test/java/de/juplo/demo/DemoApplicationIT.java | 11 ++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) 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 -- 2.20.1