diff options
-rw-r--r-- | src/test/scala/kamon/instrumentation/FutureInstrumentationSpec.scala | 25 |
1 files changed, 25 insertions, 0 deletions
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" + } + } +} |