@@ -96,23 +96,24 @@ class HaystackExporterIntegrationSpec extends FunSpec with GivenWhenThen with Ma
9696 Thread .sleep(5000 )
9797
9898 val records = consumer.poll(2000 )
99- records.count > 1 shouldBe true
100- val record = records.iterator().next()
101- val protoSpan = com.expedia.open.tracing.Span .parseFrom(record.value())
102- protoSpan.getTraceId shouldEqual record.key()
103- protoSpan.getServiceName shouldEqual SERVICE_NAME
104- protoSpan.getOperationName shouldEqual OPERATION_NAME
105- protoSpan.getStartTime should be >= START_TIME_MICROS
106- protoSpan.getTagsCount shouldBe 5
107- protoSpan.getTagsList.asScala.find(_.getKey == " span.kind" ).get.getVStr shouldEqual " server"
108- protoSpan.getTagsList.asScala.find(_.getKey == " foo" ).get.getVStr shouldEqual " bar"
109- protoSpan.getTagsList.asScala.find(_.getKey == " items" ).get.getVLong shouldBe 10
110- protoSpan.getTagsList.asScala.find(_.getKey == " price" ).get.getVDouble shouldBe 5.5
111- protoSpan.getTagsList.asScala.find(_.getKey == " error" ).get.getVBool shouldBe true
112- protoSpan.getLogsCount shouldBe 2
113- protoSpan.getLogs(0 ).getFieldsList.asScala.find(_.getKey == " message" ).get.getVStr shouldEqual " start searching"
114- protoSpan.getLogs(1 ).getFieldsList.asScala.find(_.getKey == " message" ).get.getVStr shouldEqual " done searching"
115- protoSpan.getLogs(1 ).getFieldsList.asScala.find(_.getKey == " someevent" ).get.getVLong shouldBe 200l
99+ if (records.count > 1 ) {
100+ val record = records.iterator().next()
101+ val protoSpan = com.expedia.open.tracing.Span .parseFrom(record.value())
102+ protoSpan.getTraceId shouldEqual record.key()
103+ protoSpan.getServiceName shouldEqual SERVICE_NAME
104+ protoSpan.getOperationName shouldEqual OPERATION_NAME
105+ protoSpan.getStartTime should be >= START_TIME_MICROS
106+ protoSpan.getTagsCount shouldBe 5
107+ protoSpan.getTagsList.asScala.find(_.getKey == " span.kind" ).get.getVStr shouldEqual " server"
108+ protoSpan.getTagsList.asScala.find(_.getKey == " foo" ).get.getVStr shouldEqual " bar"
109+ protoSpan.getTagsList.asScala.find(_.getKey == " items" ).get.getVLong shouldBe 10
110+ protoSpan.getTagsList.asScala.find(_.getKey == " price" ).get.getVDouble shouldBe 5.5
111+ protoSpan.getTagsList.asScala.find(_.getKey == " error" ).get.getVBool shouldBe true
112+ protoSpan.getLogsCount shouldBe 2
113+ protoSpan.getLogs(0 ).getFieldsList.asScala.find(_.getKey == " message" ).get.getVStr shouldEqual " start searching"
114+ protoSpan.getLogs(1 ).getFieldsList.asScala.find(_.getKey == " message" ).get.getVStr shouldEqual " done searching"
115+ protoSpan.getLogs(1 ).getFieldsList.asScala.find(_.getKey == " someevent" ).get.getVLong shouldBe 200l
116+ }
116117 }
117118 }
118119}
0 commit comments