Remove test reliance on application.conf (#25027)

This commit is contained in:
Christopher Batey 2018-05-08 10:33:36 +01:00 committed by GitHub
parent 9b7c2a8cb4
commit 69a8a77949
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 28 deletions

View file

@ -1,26 +0,0 @@
akka.loglevel = DEBUG
akka.actor.debug.lifecycle = off
dispatcher-1 {
fork-join-executor {
parallelism-min=1
parallelism-max=1
}
}
dispatcher-2 {
fork-join-executor {
parallelism-min=2
parallelism-max=2
}
}
dispatcher-8 {
fork-join-executor {
parallelism-min=8
parallelism-max=8
}
}
akka.typed {
# for the akka.actor.ExtensionSpec
library-extensions += "akka.actor.typed.InstanceCountingExtension"
}

View file

@ -50,6 +50,15 @@ object InstanceCountingExtension extends ExtensionId[DummyExtension1] {
}
}
object ExtensionsSpec {
val config = ConfigFactory.parseString(
"""
akka.typed {
library-extensions += "akka.actor.typed.InstanceCountingExtension"
}
""").resolve()
}
class ExtensionsSpec extends TypedAkkaSpec {
"The extensions subsystem" must {
@ -161,7 +170,7 @@ class ExtensionsSpec extends TypedAkkaSpec {
"load registered typed extensions eagerly even for untyped system" in {
import akka.actor.typed.scaladsl.adapter._
val beforeCreation = InstanceCountingExtension.createCount.get()
val untypedSystem = akka.actor.ActorSystem()
val untypedSystem = akka.actor.ActorSystem("as", ExtensionsSpec.config)
try {
val before = InstanceCountingExtension.createCount.get()
InstanceCountingExtension(untypedSystem.toTyped)
@ -212,7 +221,7 @@ class ExtensionsSpec extends TypedAkkaSpec {
val bootstrap = config match {
case Some(c) BootstrapSetup(c)
case None BootstrapSetup()
case None BootstrapSetup(ExtensionsSpec.config)
}
val system = setup match {
case None ActorSystem[Any](Behavior.EmptyBehavior, name, bootstrap)