Spring MVC controller Test - print the result JSON String

前端 未结 5 2184
一向
一向 2021-01-30 05:03

Hi I have a Spring mvc controller

@RequestMapping(value = \"/jobsdetails/{userId}\", method = RequestMethod.GET)
@ResponseBody
public List jobsDetai         


        
5条回答
  •  萌比男神i
    2021-01-30 05:28

    If you are testing the Controller, you won't get the JSon result, which is returned by the view. Whether you can test the view (or test the controller and then the view), or starting a servlet contrainer (with Cargo for example), and test at HTTP level, which is a good way to check what really happen.

提交回复
热议问题