From de7cbe9f32ba75b6c51a78fbb59b9de94a2a9244 Mon Sep 17 00:00:00 2001 From: Diego Parra Date: Fri, 24 May 2013 00:31:29 -0300 Subject: fix FutureTest --- .../FutureInstrumentationSpec.scala | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/test/scala/kamon/instrumentation/FutureInstrumentationSpec.scala (limited to 'src') diff --git a/src/test/scala/kamon/instrumentation/FutureInstrumentationSpec.scala b/src/test/scala/kamon/instrumentation/FutureInstrumentationSpec.scala new file mode 100644 index 00000000..2eb8d07a --- /dev/null +++ b/src/test/scala/kamon/instrumentation/FutureInstrumentationSpec.scala @@ -0,0 +1,25 @@ +package kamon.instrumentation + +import scala.concurrent.{Await, Future} +import org.specs2.mutable.Specification +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent.duration.{FiniteDuration, DurationLong} +import org.specs2.time.{ Duration => SpecsDuration } + + +class FutureInstrumentationSpec extends Specification { + import Await.result + implicit def specsDuration2Akka(duration: SpecsDuration): FiniteDuration = new DurationLong(duration.inMillis).millis + + "a instrumented Future" should { + "preserve the transaction context available during the future creation" in { + + } + + "use the same context available at creation when executing the onComplete callback" in { + val future = Future { "hello" } + + result(future, 100 millis) === "hello" + } + } +} -- cgit v1.2.3