我想对这个 Spring 控制器方法进行单元测试:
@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);
我正在使用 JMock。我如何模拟验证器以通过调用测试控制器
controller.register(....) ?