@@ -556,7 +556,7 @@ class TraceMapperV1PayloadTest extends DDSpecification {
556556
557557 Integer priority = null
558558 String origin = null
559- int chunkAttributesCount = -1
559+ Map< String , Object > chunkAttributes = null
560560 byte [] traceId = null
561561 Integer samplingMechanism = null
562562 List<TraceGenerator.PojoSpan > decodedSpans = null
@@ -571,7 +571,7 @@ class TraceMapperV1PayloadTest extends DDSpecification {
571571 origin = readStreamingString(unpacker, stringTable)
572572 break
573573 case 3 :
574- chunkAttributesCount = unpacker . unpackArrayHeader( )
574+ chunkAttributes = readAttributes(unpacker, stringTable )
575575 break
576576 case 4 :
577577 decodedSpans = verifySpans(unpacker, expectedTrace, stringTable)
@@ -591,14 +591,16 @@ class TraceMapperV1PayloadTest extends DDSpecification {
591591
592592 assertNotNull (priority)
593593 assertNotNull (origin)
594+ assertNotNull (chunkAttributes)
594595 assertNotNull (decodedSpans)
595596 assertNotNull (traceId)
596597 assertNotNull (samplingMechanism)
597- assertEquals (0 , chunkAttributesCount)
598598
599599 TraceGenerator.PojoSpan firstSpan = expectedTrace. get(0 )
600600 assertEquals (firstSpan. samplingPriority(), priority)
601601 assertEqualsWithNullAsEmpty(firstSpan. getOrigin(), origin)
602+ assertEquals (1 , chunkAttributes. size())
603+ assertEqualsWithNullAsEmpty(firstSpan. getLocalRootSpan(). getServiceName(), chunkAttributes. get(" service" ))
602604 assertArrayEquals (firstSpan. getTraceId(). to128BitBytes(), traceId)
603605 assertEquals (expectedSamplingMechanism(firstSpan. getTags()), samplingMechanism)
604606 }
@@ -843,19 +845,25 @@ class TraceMapperV1PayloadTest extends DDSpecification {
843845 readStreamingString(unpacker, stringTable)
844846 break
845847 case 3 :
846- unpacker . unpackArrayHeader( )
848+ readAttributes(unpacker, stringTable )
847849 break
848850 case 4 :
849851 int spanCount = unpacker. unpackArrayHeader()
850852 for (int i = 0 ; i < spanCount; i++ ) {
851853 skipSpan(unpacker, stringTable)
852854 }
853855 break
856+ case 5 :
857+ unpacker. unpackBoolean()
858+ break
854859 case 6 :
855860 int len = unpacker. unpackBinaryHeader()
856861 byte [] ignored = new byte [len]
857862 unpacker. readPayload(ignored)
858863 break
864+ case 7 :
865+ unpacker. unpackInt()
866+ break
859867 default :
860868 Assertions . fail (" Unexpected chunk field id while skipping: " + fieldId)
861869 }
0 commit comments