blob: 0026d9537f9db6d320158b8d751a0fdf556c1bd7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
package akka.instrumentation
import org.scalatest.{WordSpecLike, Matchers}
import akka.actor.{Actor, Props, ActorSystem}
import akka.testkit.{ImplicitSender, TestKit}
import kamon.{TraceContext, Kamon}
class ActorInstrumentationSpec extends TestKit(ActorSystem("ActorInstrumentationSpec")) with WordSpecLike with Matchers with ImplicitSender {
"an instrumented actor ref" when {
"used inside the context of a transaction" should {
"propagate the trace context using bang" in new TraceContextEchoFixture {
echo ! "test"
expectMsg(Some(testTraceContext))
}
"propagate the trace context using tell" in {
}
"propagate the trace context using ask" in {
}
}
}
trait TraceContextEchoFixture {
val testTraceContext = Kamon.newTraceContext()
val echo = system.actorOf(Props[TraceContextEcho])
Kamon.set(testTraceContext)
}
}
class TraceContextEcho extends Actor {
def receive = {
case msg ⇒ sender ! Kamon.context()
}
}
|