Concept Flow - @WebMvcTest for controller testing
Start Test
Load @WebMvcTest Context
Inject MockMvc
Perform HTTP Request
Controller Handles Request
Return Response
Assert Response & Status
Test Ends
The test starts by loading only the web layer with @WebMvcTest, then MockMvc performs a simulated HTTP request to the controller, which handles it and returns a response that the test asserts.