Mastering Spring 5.0
上QQ阅读APP看书,第一时间看更新

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();