diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-02-15 11:16:21 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-02-15 11:16:21 +0100 |
commit | 30ec5adec206f82367020de74e79cd2aa124bf9b (patch) | |
tree | d1b6429f5679e13979612ad421aa5bb8288ed411 /kamon-core/src/test/scala/kamon/trace/TraceLocalSpec.scala | |
parent | 8cd862debfbfa6d92473d601880cbd7c088601a1 (diff) | |
download | Kamon-30ec5adec206f82367020de74e79cd2aa124bf9b.tar.gz Kamon-30ec5adec206f82367020de74e79cd2aa124bf9b.tar.bz2 Kamon-30ec5adec206f82367020de74e79cd2aa124bf9b.zip |
! core: move the TraceContext manipulation API to the Tracer companion object.
Diffstat (limited to 'kamon-core/src/test/scala/kamon/trace/TraceLocalSpec.scala')
-rw-r--r-- | kamon-core/src/test/scala/kamon/trace/TraceLocalSpec.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/kamon-core/src/test/scala/kamon/trace/TraceLocalSpec.scala b/kamon-core/src/test/scala/kamon/trace/TraceLocalSpec.scala index 8bacca83..b58b247f 100644 --- a/kamon-core/src/test/scala/kamon/trace/TraceLocalSpec.scala +++ b/kamon-core/src/test/scala/kamon/trace/TraceLocalSpec.scala @@ -30,7 +30,7 @@ class TraceLocalSpec extends BaseKamonSpec("trace-local-spec") with PatienceConf "the TraceLocal storage" should { "allow storing and retrieving values" in { - TraceContext.withContext(newContext("store-and-retrieve-trace-local")) { + Tracer.withContext(newContext("store-and-retrieve-trace-local")) { val testString = "Hello World" TraceLocal.store(SampleTraceLocalKey)(testString) @@ -39,7 +39,7 @@ class TraceLocalSpec extends BaseKamonSpec("trace-local-spec") with PatienceConf } "return None when retrieving a non existent key" in { - TraceContext.withContext(newContext("non-existent-key")) { + Tracer.withContext(newContext("non-existent-key")) { TraceLocal.retrieve(SampleTraceLocalKey) should equal(None) } } @@ -50,22 +50,22 @@ class TraceLocalSpec extends BaseKamonSpec("trace-local-spec") with PatienceConf "be attached to the TraceContext when it is propagated" in { val testString = "Hello World" - val testContext = TraceContext.withContext(newContext("manually-propagated-trace-local")) { + val testContext = Tracer.withContext(newContext("manually-propagated-trace-local")) { TraceLocal.store(SampleTraceLocalKey)(testString) TraceLocal.retrieve(SampleTraceLocalKey).value should equal(testString) - TraceContext.currentContext + Tracer.currentContext } /** No TraceLocal should be available here */ TraceLocal.retrieve(SampleTraceLocalKey) should equal(None) - TraceContext.withContext(testContext) { + Tracer.withContext(testContext) { TraceLocal.retrieve(SampleTraceLocalKey).value should equal(testString) } } "allow retrieve a value from the MDC when was created a key with AvailableToMdc(cool-key)" in { - TraceContext.withContext(newContext("store-and-retrieve-trace-local-and-copy-to-mdc")) { + Tracer.withContext(newContext("store-and-retrieve-trace-local-and-copy-to-mdc")) { val testString = "Hello MDC" TraceLocal.store(SampleTraceLocalKeyAvailableToMDC)(testString) @@ -78,7 +78,7 @@ class TraceLocalSpec extends BaseKamonSpec("trace-local-spec") with PatienceConf } "allow retrieve a value from the MDC when was created a key with AvailableToMdc.storeForMdc(String, String)" in { - TraceContext.withContext(newContext("store-and-retrieve-trace-local-and-copy-to-mdc")) { + Tracer.withContext(newContext("store-and-retrieve-trace-local-and-copy-to-mdc")) { val testString = "Hello MDC" TraceLocal.storeForMdc("someKey", testString) |