From: Kai Moritz <kai@juplo.de>
Date: Sun, 9 Apr 2023 07:56:14 +0000 (+0200)
Subject: Spring Initializr: 3.1.0-M2 / Spring WebMVC / Thymeleaf
X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;ds=sidebyside;p=demos%2Fspring-boot

Spring Initializr: 3.1.0-M2 / Spring WebMVC / Thymeleaf

- Migrated the template to WebMVC
---

diff --git a/pom.xml b/pom.xml
index 4e5b16c..3a71f8c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
 		</dependency>
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-webflux</artifactId>
+			<artifactId>spring-boot-starter-web</artifactId>
 		</dependency>
 
 		<dependency>
@@ -32,8 +32,8 @@
 			<scope>test</scope>
 		</dependency>
 		<dependency>
-			<groupId>io.projectreactor</groupId>
-			<artifactId>reactor-test</artifactId>
+			<groupId>org.assertj</groupId>
+			<artifactId>assertj-core</artifactId>
 			<scope>test</scope>
 		</dependency>
 		<dependency>
diff --git a/src/test/java/de/juplo/demo/DemoApplicationTests.java b/src/test/java/de/juplo/demo/DemoApplicationTests.java
index e16b8ec..850debd 100644
--- a/src/test/java/de/juplo/demo/DemoApplicationTests.java
+++ b/src/test/java/de/juplo/demo/DemoApplicationTests.java
@@ -2,13 +2,16 @@ 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.autoconfigure.web.servlet.AutoConfigureMockMvc;
 import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.web.reactive.server.WebTestClient;
+import org.springframework.test.web.servlet.MockMvc;
+
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
 
 
 @SpringBootTest
-@AutoConfigureWebTestClient
+@AutoConfigureMockMvc
 class DemoApplicationTests {
 
 	@Test
@@ -17,10 +20,8 @@ class DemoApplicationTests {
 
 
 	@Test
-	void getWelcomeResponseIsOk(@Autowired WebTestClient webClient) {
-		webClient
-				.get().uri("/")
-				.exchange()
-				.expectStatus().isOk();
+	void getWelcomeResponseIsOk(@Autowired MockMvc mvc) throws Exception
+	{
+		mvc.perform(get("/")).andExpect(status().isOk());
 	}
 }