问题描述:

im trying to Inject the Configuration class to my tests, so I extend my test class with ConfiguredApp like this:

@DoNotDiscover()

class MySpec extends FreeSpec with Matchers with GeneratorDrivenPropertyChecks with ScalaFutures with ConfiguredApp

and i declared a lazy val of configuration like this:

 lazy val configuration = app.injector.instanceOf[Configuration]

but im getting this error:

Exception encountered when invoking run on a nested suite -

ConfiguredApp needs an Application value associated with key

"org.scalatestplus.play.app" in the config map. Did you forget to

annotate a nested suite with @DoNotDiscover?

java.lang.IllegalArgumentException: ConfiguredApp needs an Application

value associated with key "org.scalatestplus.play.app" in the config

map. Did you forget to annotate a nested suite with @DoNotDiscover?

相关阅读:
Top