I want to unit test this Spring controller method:
@Autowired
private MyValidator validator;
public String register(
HttpServletRequest request,
ModelMap model,
Principal principal,
@PathVariable Plain plain,
RedirectAttributes ratts,
@ModelAttribute @Valid PlainMoreObject pmo,
BindingResult result)
{
validator.validate(pmo, result);
I'm using JMock. How do I mock the validator in order to test controller by calling
controller.register(....) ?