Robin Wieruch
Robin Wieruch

Reputation: 15898

How to fake a json post request in Play 2.1.1

T tried a lot of approaches in play java for faking a post request to my controller, but nothing worked for me.

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

It always says the method fakeRequest() is undefinded in eclipse.

Upvotes: 0

Views: 822

Answers (1)

Woof Woof
Woof Woof

Reputation: 23

Add import static play.test.Helpers.*

Upvotes: 1

Related Questions