2017-06-21 12 views
1

からとScalaのプレイフレームワークのバージョン2.6からの移行ガイドに従うことをしよう: https://playframework.com/documentation/2.6.x/Highlights26Scalaのプレイユニットテストコントローラの2.6.x - パッケージの同時でのオブジェクトの実行が推奨されていません:2.6移行ガイドをご覧ください

と私をアップグレードした後テストが破壊されています

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 

は、これは私のコントローラDECLARですエーション:

class ProductController @Inject()(cc: ProductControllerComponents)(implicit ec: ExecutionContext) 
    extends ProductBaseController(cc) 

と私の注入された実行コンテキストが「のExecutionContext:scala.concurrent.ExecutionContext」である私は、公式プレイフレームワーク2.6の例を以下のよ、まだテストは、上記のエラーMSGを投げてコンパイルされていない

答えて

0

playframework/framework/src/play/src/main/scala/play/api/mvc/Controller.scala

/** 
    * The default execution context provided by Play. You should use this for non-blocking code only. You can do so by 
    * passing it explicitly, or by defining an implicit in your controller like so: 
    * 
    * {{{ 
    * implicit lazy val executionContext = defaultExecutionContext 
    * }}} 
    */ 
    def defaultExecutionContext: ExecutionContext = controllerComponents.executionContext 
を参照してください。
関連する問題