Skip to content

Commit

Permalink
Simplify MockMvcTester setup
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll authored and odrotbohm committed Jun 25, 2024
1 parent cbabb16 commit 80a00a4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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());
}

Expand Down

0 comments on commit 80a00a4

Please sign in to comment.