From 8a7f2fdc3bb722a0768cddc4c369cc6a73c54d8b Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 7 Apr 2023 14:27:23 +0200 Subject: [PATCH] Added a test that asserts, that the welcome page can be loaded --- .../java/de/juplo/demo/DemoApplicationTests.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/de/juplo/demo/DemoApplicationTests.java b/src/test/java/de/juplo/demo/DemoApplicationTests.java index 791a60b..e16b8ec 100644 --- a/src/test/java/de/juplo/demo/DemoApplicationTests.java +++ b/src/test/java/de/juplo/demo/DemoApplicationTests.java @@ -1,13 +1,26 @@ package de.juplo.demo; import org.junit.jupiter.api.Test; +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; + @SpringBootTest +@AutoConfigureWebTestClient class DemoApplicationTests { @Test void contextLoads() { } + + @Test + void getWelcomeResponseIsOk(@Autowired WebTestClient webClient) { + webClient + .get().uri("/") + .exchange() + .expectStatus().isOk(); + } } -- 2.20.1