如何在Play 2.1.1中伪造json post请求

时间:2013-06-05 10:35:17

标签: java playframework playframework-2.0

T在java中试了很多方法来伪造一个帖子请求到我的控制器,但是没有什么对我有用。

callAction(controllers.routes.ref.MyController.myFunction(), fakeRequest().withHeader("Content-Type", "application/json").withJsonBody(json));

它总是在日食中说the method fakeRequest() is undefinded

1 个答案:

答案 0 :(得分:1)

添加import static play.test.Helpers。*