From 80a00a46640adba461fd00a6f5c57810b45b5f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Wed, 19 Jun 2024 17:57:57 +0200 Subject: [PATCH] Simplify MockMvcTester setup --- .../springsource/restbucks/AbstractWebIntegrationTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/test/java/org/springsource/restbucks/AbstractWebIntegrationTest.java b/server/src/test/java/org/springsource/restbucks/AbstractWebIntegrationTest.java index 3ab0376..60278a2 100644 --- a/server/src/test/java/org/springsource/restbucks/AbstractWebIntegrationTest.java +++ b/server/src/test/java/org/springsource/restbucks/AbstractWebIntegrationTest.java @@ -31,7 +31,6 @@ import org.springframework.test.web.servlet.assertj.MockMvcTester; import org.springframework.test.web.servlet.assertj.MvcTestResult; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.util.Assert; import org.springframework.web.context.WebApplicationContext; @@ -51,8 +50,8 @@ public abstract class AbstractWebIntegrationTest { @BeforeEach void setUp() { - this.mvc = MockMvcTester.create(MockMvcBuilders.webAppContextSetup(context).// - defaultRequest(MockMvcRequestBuilders.get("/").locale(Locale.US)).// + this.mvc = MockMvcTester.from(context, builder ->// + builder.defaultRequest(MockMvcRequestBuilders.get("/").locale(Locale.US)).// build()); }