For test reasons I’d like to have a method signature in a spring-mvc-controller with a return value which should be ignored by spring:
@RequestMapping(value = "/{uuid}", params = "question", method = RequestMethod.POST)
@ResponseBody
public IAnswer saveAnswer(UiAnswer json, @PathVariable String uuid, @RequestParam("question") String question, HttpServletResponse response) {}
It’s a post-request where the controller receives data and just responses with response.setStatus(HttpServletResponse.SC_OK); if everything went fine.
- With
@ResponseBodyit dies in a internal server error 500 - Without
@ResponseBodyspring tries to resolve the view - With
voidas the return value, it works fine
Can I tell spring to ignore my returned object?
Thanks!
Then unit-test
doSaveAnswer().