开发者

Problem in writing a JUnit test case for the Spring method

开发者 https://www.devze.com 2023-04-04 21:08 出处:网络
I test the following method by JUnit, but开发者_开发技巧 I am stuck up in mapping the attributes

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

精彩评论

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