How do I supply an implicit value for an akka.stream.Materializer when sending a FakeRequest?

前端 未结 2 1654
借酒劲吻你
借酒劲吻你 2021-02-19 23:43

I\'m trying to make sense of the error(s) I\'m seeing below, and to learn how to fix it.

could not find implicit value for parameter materializer: akka.Stream.M         


        
2条回答
  •  走了就别回头了
    2021-02-20 00:27

    You don't need Materializer.

    I believe you are calling not the right action.apply method.
    You want def apply(request: Request[A]): Future[Result]
    To call the right, you need FakeRequest[AnyContent], same parametrized type as action:Action[AnyContent].This type is forced by PlayBodyParser I believe you set for your action.

    After that you don't need .run call

提交回复
热议问题