开发者

Problem in writing a JUnit test case for the Spring method

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜