WIP:itflux wip-it
authorKai Moritz <kai@juplo.de>
Tue, 14 Jan 2020 12:34:41 +0000 (13:34 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 14 Jan 2020 12:34:41 +0000 (13:34 +0100)
pom.xml
src/test/java/de/juplo/demo/DemoApplicationIT.java

diff --git a/pom.xml b/pom.xml
index 6c5562e..0be8d19 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -16,6 +16,7 @@
 
        <properties>
                <java.version>1.8</java.version>
+               <jsoup.version>1.12.1</jsoup.version>
                <mockserver.version>5.8.1</mockserver.version>
                <testcontainers-nginx.version>1.12.4</testcontainers-nginx.version>
        </properties>
@@ -54,8 +55,9 @@
                        <scope>test</scope>
                </dependency>
                <dependency>
-                       <groupId>io.projectreactor</groupId>
-                       <artifactId>reactor-test</artifactId>
+                       <groupId>org.jsoup</groupId>
+                       <artifactId>jsoup</artifactId>
+                       <version>${jsoup.version}</version>
                        <scope>test</scope>
                </dependency>
 
index 1d8e7ac..131c52e 100644 (file)
@@ -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