I am writing test-cases for my play application controller, and I am having trouble getting the action result.
val jsonresult = UserController.importOPML()(
FakeRequest(POST, "/user/import-opml",FakeHeaders(),data)
.withCookies(cookie)
)
this would work only when the Action is specified parse.multipartFormData
, if it is changed to parse.json
type mismatch; found : play.api.libs.iteratee.Iteratee[Array[Byte],play.api.mvc.SimpleResult] required: scala.concurrent.Future[play.api.mvc.SimpleResult]
I don't know why , so I changed to
val Some(jsonresult ) = route( request )
this time the compilation can pass, but my Authentication stub cannot pass anymore. what is causing that weird error ? and if work with route, why the cookie didn't work.