diff options
Diffstat (limited to 'kamon-spray/src/test/scala/kamon')
-rw-r--r-- | kamon-spray/src/test/scala/kamon/spray/ClientRequestTracingSpec.scala | 7 | ||||
-rw-r--r-- | kamon-spray/src/test/scala/kamon/spray/ServerRequestTracingSpec.scala | 23 |
2 files changed, 14 insertions, 16 deletions
diff --git a/kamon-spray/src/test/scala/kamon/spray/ClientRequestTracingSpec.scala b/kamon-spray/src/test/scala/kamon/spray/ClientRequestTracingSpec.scala index 393ae6ff..c7ec2a5f 100644 --- a/kamon-spray/src/test/scala/kamon/spray/ClientRequestTracingSpec.scala +++ b/kamon-spray/src/test/scala/kamon/spray/ClientRequestTracingSpec.scala @@ -5,13 +5,12 @@ import akka.actor.ActorSystem import org.scalatest.WordSpecLike import spray.httpx.RequestBuilding import spray.client.pipelining._ -import kamon.trace.{UowTrace, Trace} +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 { @@ -20,8 +19,8 @@ class ClientRequestTracingSpec extends TestKit(ActorSystem("server-request-traci 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()) + // 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) diff --git a/kamon-spray/src/test/scala/kamon/spray/ServerRequestTracingSpec.scala b/kamon-spray/src/test/scala/kamon/spray/ServerRequestTracingSpec.scala index e54fe24f..cd6d105d 100644 --- a/kamon-spray/src/test/scala/kamon/spray/ServerRequestTracingSpec.scala +++ b/kamon-spray/src/test/scala/kamon/spray/ServerRequestTracingSpec.scala @@ -24,7 +24,7 @@ import scala.concurrent.Await import scala.concurrent.duration._ import _root_.spray.client.pipelining._ import akka.util.Timeout -import kamon.trace.{UowTrace, Trace} +import kamon.trace.{ UowTrace, Trace } import kamon.Kamon class ServerRequestTracingSpec extends TestKit(ActorSystem("server-request-tracing-spec")) with WordSpecLike with RequestBuilding with TestServer { @@ -62,13 +62,13 @@ class ServerRequestTracingSpec extends TestKit(ActorSystem("server-request-traci } def fishForNamedTrace(traceName: String) = fishForMessage() { - case trace: UowTrace if trace.name.contains(traceName) => true - case _ => false + case trace: UowTrace if trace.name.contains(traceName) ⇒ true + case _ ⇒ false } } trait TestServer extends SimpleRoutingApp { - self: TestKit => + self: TestKit ⇒ Kamon(Trace).tell(Trace.Register, testActor) @@ -79,15 +79,14 @@ trait TestServer extends SimpleRoutingApp { path("ok") { complete("ok") } ~ - path("clearcontext"){ - complete { - println("The Context in the route is: " + Trace.context) - Trace.clear - "ok" + path("clearcontext") { + complete { + println("The Context in the route is: " + Trace.context) + Trace.clear + "ok" + } } - } - } - ), timeout.duration).localAddress.getPort + }), timeout.duration).localAddress.getPort val send = sendReceive(system, system.dispatcher, timeout) |