</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-webflux</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ </plugin>
</plugins>
</build>
--- /dev/null
+package de.juplo.demo;
+
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.web.reactive.server.WebTestClient;
+
+import java.net.URI;
+
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@AutoConfigureWebTestClient
+class ExceptionHandlingApplicationIT {
+ private final static Logger LOG =
+ LoggerFactory.getLogger(ExceptionHandlingApplicationIT.class);
+
+ @Autowired
+ WebTestClient client;
+
+
+ @Test
+ void contextLoads() throws Exception {
+ }
+
+ @Test
+ void test200() throws Exception {
+ client
+ .get()
+ .uri("/?template=a")
+ .exchange()
+ .expectStatus().isOk();
+ client
+ .get()
+ .uri("/?template=b")
+ .exchange()
+ .expectStatus().isOk();
+ }
+
+ @Test
+ void test503ByController() throws Exception {
+ client
+ .get()
+ .uri("/?template=foo")
+ .exchange()
+ .expectStatus().is5xxServerError();
+ }
+
+ @Test
+ void test503ByInfrastructure() throws Exception {
+ client
+ .get()
+ .uri("/?template=boom")
+ .exchange()
+ .expectStatus().is5xxServerError();
+ }
+}