diff options
Diffstat (limited to 'kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala')
-rw-r--r-- | kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala | 60 |
1 files changed, 28 insertions, 32 deletions
diff --git a/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala b/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala index 184953b1..89251bf4 100644 --- a/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala +++ b/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorMessagePassingTracingSpec.scala @@ -15,56 +15,55 @@ * ========================================================== */ package kamon.trace.instrumentation -import org.scalatest.{WordSpecLike, Matchers} -import akka.actor.{ActorRef, Actor, Props, ActorSystem} +import org.scalatest.{ WordSpecLike, Matchers } +import akka.actor.{ ActorRef, Actor, Props, ActorSystem } -import akka.testkit.{ImplicitSender, TestKit} +import akka.testkit.{ ImplicitSender, TestKit } import kamon.trace.Trace -import akka.pattern.{pipe, ask} +import akka.pattern.{ pipe, ask } import akka.util.Timeout import scala.concurrent.duration._ -import scala.concurrent.{Await, Future} +import scala.concurrent.{ Await, Future } import akka.routing.RoundRobinRouter import kamon.trace.TraceContext - class ActorMessagePassingTracingSpec extends TestKit(ActorSystem("actor-message-passing-tracing-spec")) with WordSpecLike with ImplicitSender { implicit val executionContext = system.dispatcher "the message passing instrumentation" should { - "propagate the TraceContext using bang" in new TraceContextEchoFixture { - Trace.withContext(testTraceContext) { - ctxEchoActor ! "test" - } - - expectMsg(testTraceContext) + "propagate the TraceContext using bang" in new TraceContextEchoFixture { + Trace.withContext(testTraceContext) { + ctxEchoActor ! "test" } - "propagate the TraceContext using tell" in new TraceContextEchoFixture { - Trace.withContext(testTraceContext) { - ctxEchoActor.tell("test", testActor) - } + expectMsg(testTraceContext) + } - expectMsg(testTraceContext) + "propagate the TraceContext using tell" in new TraceContextEchoFixture { + Trace.withContext(testTraceContext) { + ctxEchoActor.tell("test", testActor) } - "propagate the TraceContext using ask" in new TraceContextEchoFixture { - implicit val timeout = Timeout(1 seconds) - Trace.withContext(testTraceContext) { - // The pipe pattern use Futures internally, so FutureTracing test should cover the underpinnings of it. - (ctxEchoActor ? "test") pipeTo(testActor) - } + expectMsg(testTraceContext) + } - expectMsg(testTraceContext) + "propagate the TraceContext using ask" in new TraceContextEchoFixture { + implicit val timeout = Timeout(1 seconds) + Trace.withContext(testTraceContext) { + // The pipe pattern use Futures internally, so FutureTracing test should cover the underpinnings of it. + (ctxEchoActor ? "test") pipeTo (testActor) } - "propagate the TraceContext to actors behind a router" in new RoutedTraceContextEchoFixture { - Trace.withContext(testTraceContext) { - ctxEchoActor ! "test" - } + expectMsg(testTraceContext) + } - expectMsg(testTraceContext) + "propagate the TraceContext to actors behind a router" in new RoutedTraceContextEchoFixture { + Trace.withContext(testTraceContext) { + ctxEchoActor ! "test" } + + expectMsg(testTraceContext) + } } trait TraceContextEchoFixture { @@ -83,6 +82,3 @@ class TraceContextEcho extends Actor { } } - - - |