AkkaActorTest.groovy 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright The OpenTelemetry Authors
  3. * SPDX-License-Identifier: Apache-2.0
  4. */
  5. import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
  6. class AkkaActorTest extends AgentInstrumentationSpecification {
  7. def "akka #testMethod #count"() {
  8. setup:
  9. AkkaActors akkaTester = new AkkaActors()
  10. count.times {
  11. akkaTester."$testMethod"()
  12. }
  13. expect:
  14. assertTraces(count) {
  15. count.times {
  16. trace(it, 2) {
  17. span(0) {
  18. name "parent"
  19. attributes {
  20. }
  21. }
  22. span(1) {
  23. name "$expectedGreeting, Akka"
  24. childOf span(0)
  25. attributes {
  26. }
  27. }
  28. }
  29. }
  30. }
  31. where:
  32. testMethod | expectedGreeting | count
  33. "basicTell" | "Howdy" | 1
  34. "basicAsk" | "Howdy" | 1
  35. "basicForward" | "Hello" | 1
  36. "basicTell" | "Howdy" | 150
  37. "basicAsk" | "Howdy" | 150
  38. "basicForward" | "Hello" | 150
  39. }
  40. }