尝试遵循 Scala 播放框架 2.6 版的迁移指南: https ://playframework.com/documentation/2.6.x/Highlights26
升级后我的测试失败了:
val controller = new ProductController(stubControllerComponents().asInstanceOf[ProductControllerComponents])
我得到:
> object Execution in package concurrent is deprecated: Please see
> https://www.playframework.com/documentation/2.6.x/Migration26#Execution
这是我的控制器声明:
class ProductController @Inject()(cc: ProductControllerComponents)(implicit ec: ExecutionContext)
extends ProductBaseController(cc)
我注入的执行上下文是“executionContext:scala.concurrent.ExecutionContext”
我正在关注官方播放框架 2.6 示例,但仍然测试未编译并抛出上面的错误消息。