springboot的junit4模拟request、response对象
关键字:
MockHttpRequest、Mock测试
问题:
在模拟junit的request、response对象时,会报如下空指针异常。
处理方法:
可用MockHttpServletRequest、MockHttpServletResponse代替即可。
在测试类上可加注解
菜鸟码农,喜欢和谦虚爱学习积极向上的同学做朋友,请留言多指教。
喜欢和谦虚爱学习积极向上的同学做朋友,有问题请多指教。
关键字:
MockHttpRequest、Mock测试
问题:
在模拟junit的request、response对象时,会报如下空指针异常。
处理方法:
可用MockHttpServletRequest、MockHttpServletResponse代替即可。
在测试类上可加注解