All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lerna.testkit.akka.AkkaSpanScaleFactorSupport.scala Maven / Gradle / Ivy

There is a newer version: 3.0.4
Show newest version
package lerna.testkit.akka

import akka.actor.ActorSystem
import akka.testkit.TestKitExtension
import org.scalatest.concurrent.ScaledTimeSpans

/** A trait that provides time scale factor integration of Akka TestKit and ScalaTest
  *
  * ==Overview==
  * The trait can be used with [[akka.testkit.TestKit]] or other Akka classic test kits such as
  * [[https://doc.akka.io/api/akka-http/current/akka/http/scaladsl/testkit/ScalatestRouteTest.html ScalaTestRouteTest]]
  *
  * The time scale factor can be configured by `akka.test.timefactor` in a configuration file.
  */
trait AkkaSpanScaleFactorSupport extends ScaledTimeSpans {
  // No trait provides the ActorSystem in both TestKit and RouteTest
  implicit val system: ActorSystem

  /** Configure the ScalaTest time factor from Akka TestKit's test time factor.
    * 

* Configure the timefactor in your configuration file like this: `akka.test.timefactor = 3.0` *

* See also: ScaledTimeSpans */ override def spanScaleFactor: Double = TestKitExtension(system).TestTimeFactor }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy