【发布时间】:2010-11-05 18:50:38
【问题描述】:
如何为使用注解 @RequestParam 的 Spring MVC 控制器创建单元测试?我已经为在 handlerequest 方法中使用 HttpServletRequest 对象的控制器创建了 junit 测试,但我正在寻找一种使用 @RequestParam 测试控制器的方法。
谢谢
@RequestMapping("/call.action")
public ModelAndView getDBRecords(@RequestParam("id") String id) {
Employee employee = service.retrieveEmployee(id);
}
【问题讨论】:
标签: unit-testing spring spring-mvc