Skip to main content

MockMvc

Learn MockMvc (Spring MVC Testing, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes MockMvc sends fake HTTP requests to your controllers through the real DispatcherServlet logic, without a network or server. Flow : mvc.perform(request) returns a ResultActions that you check with andExpect(...) . Builders : get , post , put , delete from MockMvcRequestBuilders and matchers from MockMvcResultMatchers .

More lessons in Spring MVC Testing