</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-webflux</artifactId>
+ <artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<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>
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
@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());
}
}