<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>
<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>
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;
.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