Skip to content

Commit d786629

Browse files
committed
Fix test
1 parent 8076998 commit d786629

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

dd-java-agent/instrumentation/avro/src/test/groovy/AvroDatumReaderTest.groovy

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,20 @@ class AvroDatumReaderTest extends AgentTestRunner {
167167
map.put("key2", "value2")
168168
datum.put("mapField", map)
169169

170+
// array of nested fields
171+
GenericRecord nestedRecordA = new GenericData.Record(schemaDef.getField("arrayNestedField").schema().getElementType())
172+
nestedRecordA.put("nestedString", "a")
173+
GenericRecord nestedRecordB = new GenericData.Record(schemaDef.getField("arrayNestedField").schema().getElementType())
174+
nestedRecordB.put("nestedString", "b")
175+
datum.put("arrayNestedField", Arrays.asList(nestedRecordA, nestedRecordB))
176+
177+
// map of nested fields
178+
Map<String, GenericRecord> nestedMap = new HashMap<>()
179+
GenericRecord nestedRecordC = new GenericData.Record(schemaDef.getField("mapNestedField").schema().getValueType())
180+
nestedRecordC.put("nestedString", "a")
181+
nestedMap.put("key1", nestedRecordC)
182+
datum.put("mapNestedField", nestedMap)
183+
170184
when:
171185
def bytes
172186
ByteArrayOutputStream out = new ByteArrayOutputStream()

0 commit comments

Comments
 (0)