The essential action is RequestHeader => Iteratee[Indata, Result] , you can apply it to FakeRequest since it implements RequestHeader . To actually perform an iteration, you either populate it with data, or simply immediately indicate that there are no more indates. For both cases, you get Future[Result] back, which you need to wait in tests.
So, for a simple GET without the request body (using the wait method of the playback helper), you can do this as follows:
val iteratee = controllers.SomeController.action()(FakeRequest()) val result: Result = await(iteratee.run)
If you want to make requests with the request authorities, you will need to do something else in order to be able to submit the body of the request for iteration, as well as correctly process the encoding data of your indata.
source share