diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2013-12-04 09:24:53 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2013-12-04 09:24:53 -0300 |
commit | 5e214a33acabe972865dfab637556d680925d869 (patch) | |
tree | 0bcc7ee239ec72a98330540a793045eea3fc3439 /kamon-spray/src/test/scala/kamon/spray/ClientRequestTracingSpec.scala | |
parent | 6150d254657fa2c855b2c1825257a7210bdb2654 (diff) | |
download | Kamon-5e214a33acabe972865dfab637556d680925d869.tar.gz Kamon-5e214a33acabe972865dfab637556d680925d869.tar.bz2 Kamon-5e214a33acabe972865dfab637556d680925d869.zip |
first approach to client instrumentation testing
Diffstat (limited to 'kamon-spray/src/test/scala/kamon/spray/ClientRequestTracingSpec.scala')
-rw-r--r-- | kamon-spray/src/test/scala/kamon/spray/ClientRequestTracingSpec.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/kamon-spray/src/test/scala/kamon/spray/ClientRequestTracingSpec.scala b/kamon-spray/src/test/scala/kamon/spray/ClientRequestTracingSpec.scala new file mode 100644 index 00000000..393ae6ff --- /dev/null +++ b/kamon-spray/src/test/scala/kamon/spray/ClientRequestTracingSpec.scala @@ -0,0 +1,31 @@ +package kamon.spray + +import akka.testkit.TestKit +import akka.actor.ActorSystem +import org.scalatest.WordSpecLike +import spray.httpx.RequestBuilding +import spray.client.pipelining._ +import kamon.trace.{UowTrace, Trace} +import scala.concurrent.Await + +class ClientRequestTracingSpec extends TestKit(ActorSystem("server-request-tracing-spec")) with WordSpecLike with RequestBuilding with TestServer { + implicit val ec = system.dispatcher + + + "the client instrumentation" should { + "record segments for a client http request" in { + + Trace.start("record-segments")(system) + + send { + Get(s"http://127.0.0.1:$port/ok") + + // We don't care about the response, just make sure we finish the Trace after the response has been received. + } map(rsp => Trace.finish()) + + val trace = expectMsgType[UowTrace] + println(trace.segments) + } + } + +} |