From ddb000a4510dfce20f7090ac92ea9144403addd6 Mon Sep 17 00:00:00 2001 From: Ivan Topolnjak Date: Sat, 23 Nov 2013 21:58:28 -0300 Subject: Change withValue to withContext, seems more explicit --- .../src/test/scala/kamon/ActorMessagePassingTracingSpec.scala | 8 ++++---- kamon-trace/src/test/scala/kamon/FutureTracingSpec.scala | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'kamon-trace/src/test/scala') diff --git a/kamon-trace/src/test/scala/kamon/ActorMessagePassingTracingSpec.scala b/kamon-trace/src/test/scala/kamon/ActorMessagePassingTracingSpec.scala index 096ac986..0eaf96db 100644 --- a/kamon-trace/src/test/scala/kamon/ActorMessagePassingTracingSpec.scala +++ b/kamon-trace/src/test/scala/kamon/ActorMessagePassingTracingSpec.scala @@ -18,7 +18,7 @@ class ActorMessagePassingTracingSpec extends TestKit(ActorSystem("actor-message- "the message passing instrumentation" should { "propagate the TraceContext using bang" in new TraceContextEchoFixture { - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { ctxEchoActor ! "test" } @@ -26,7 +26,7 @@ class ActorMessagePassingTracingSpec extends TestKit(ActorSystem("actor-message- } "propagate the TraceContext using tell" in new TraceContextEchoFixture { - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { ctxEchoActor.tell("test", testActor) } @@ -35,7 +35,7 @@ class ActorMessagePassingTracingSpec extends TestKit(ActorSystem("actor-message- "propagate the TraceContext using ask" in new TraceContextEchoFixture { implicit val timeout = Timeout(1 seconds) - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { // The pipe pattern use Futures internally, so FutureTracing test should cover the underpinnings of it. (ctxEchoActor ? "test") pipeTo(testActor) } @@ -44,7 +44,7 @@ class ActorMessagePassingTracingSpec extends TestKit(ActorSystem("actor-message- } "propagate the TraceContext to actors behind a router" in new RoutedTraceContextEchoFixture { - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { ctxEchoActor ! "test" } diff --git a/kamon-trace/src/test/scala/kamon/FutureTracingSpec.scala b/kamon-trace/src/test/scala/kamon/FutureTracingSpec.scala index 7ff1b96d..1f31d4d2 100644 --- a/kamon-trace/src/test/scala/kamon/FutureTracingSpec.scala +++ b/kamon-trace/src/test/scala/kamon/FutureTracingSpec.scala @@ -20,7 +20,7 @@ class FutureTracingSpec extends WordSpec with Matchers with ScalaFutures with Pa "must be available when executing the future's body" in new TraceContextFixture { var future: Future[Option[TraceContext]] = _ - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { future = Future(Trace.context) } @@ -32,7 +32,7 @@ class FutureTracingSpec extends WordSpec with Matchers with ScalaFutures with Pa "must be available when executing callbacks on the future" in new TraceContextFixture { var future: Future[Option[TraceContext]] = _ - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { future = Future("Hello Kamon!") // The TraceContext is expected to be available during all intermediate processing. .map (_.length) -- cgit v1.2.3