Setting up the Controller to test

This step is very similar to the previous flow. We instantiate Mock MVC with BasicModelMapController:

    this.mockMvc = MockMvcBuilders.standaloneSetup       (new BasicModelMapController())       .setViewResolvers(viewResolver()).build();

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.