Spring Boot Junit单元测试MockMvc使用(MockHttpServletRequestBuilder MvcResult ModelAndView json)
项目中使用了MockMvcRequestBuilders这个类来实现单元测试特此举例get和post请求带Cookie,带参数,带对象,表单提交,url路径提交,针对@ModelAttribute,@RequestBody传参传对象获取返回对象MockHttpServletRequestBuilderMvcResultModelAndView,返回视图/json/字符串解析故作笔记,也方便日后查阅