I test the following method by JUnit, but开发者_开发技巧 I am stuck up in mapping the attributes
@RequestMapping("/a/{b}/c/{d}")
public @ResponseBody String getTranslatedXliff(Model model,
@PathVariable String templateCode, @PathVariable String localeCode){
// ...
}
Just call it:
@Test
public void test_whatever() {
controller.getTranslatedXliff(myModel, "my template code", "my locale code");
}
There's nothing magic about annotated method parameters.
精彩评论