Skip to content

Commit d702a13

Browse files
committed
update test
1 parent 34cf5f7 commit d702a13

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/SchemaBuilderTest.groovy

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ class SchemaBuilderTest extends DDCoreSpecification {
1010

1111
@Override
1212
void iterateOverSchema(datadog.trace.bootstrap.instrumentation.api.SchemaBuilder builder) {
13-
builder.addProperty("person", "name", false, "string", "name of the person", null, null, null)
14-
builder.addProperty("person", "phone_numbers", true, "string", null, null, null, null)
15-
builder.addProperty("person", "person_name", false, "string", null, null, null, null)
16-
builder.addProperty("person", "address", false, "object", null, "#/components/schemas/address", null, null)
17-
builder.addProperty("address", "zip", false, "number", null, null, "int", null)
18-
builder.addProperty("address", "street", false, "string", null, null, null, null)
13+
HashMap<String, String> extension = new HashMap<String, String>(1)
14+
extension.put("x-test-extension-1", "hello")
15+
extension.put("x-test-extension-2", "world")
16+
builder.addProperty("person", "name", false, "string", "name of the person", null, null, null, null)
17+
builder.addProperty("person", "phone_numbers", true, "string", null, null, null, null, null)
18+
builder.addProperty("person", "person_name", false, "string", null, null, null, null, null)
19+
builder.addProperty("person", "address", false, "object", null, "#/components/schemas/address", null, null, null)
20+
builder.addProperty("address", "zip", false, "number", null, null, "int", null, null)
21+
builder.addProperty("address", "street", false, "string", null, null, null, null, extension)
1922
}
2023
}
2124

@@ -31,8 +34,8 @@ class SchemaBuilderTest extends DDCoreSpecification {
3134
Schema schema = builder.build()
3235

3336
then:
34-
"{\"components\":{\"schemas\":{\"person\":{\"properties\":{\"name\":{\"description\":\"name of the person\",\"type\":\"string\"},\"phone_numbers\":{\"items\":{\"type\":\"string\"},\"type\":\"array\"},\"person_name\":{\"type\":\"string\"},\"address\":{\"\$ref\":\"#/components/schemas/address\",\"type\":\"object\"}},\"type\":\"object\"},\"address\":{\"properties\":{\"zip\":{\"format\":\"int\",\"type\":\"number\"},\"street\":{\"type\":\"string\"}},\"type\":\"object\"}}},\"openapi\":\"3.0.0\"}" == schema.definition
35-
"14950130709604290100" == schema.id
37+
"{\"components\":{\"schemas\":{\"person\":{\"properties\":{\"name\":{\"description\":\"name of the person\",\"type\":\"string\"},\"phone_numbers\":{\"items\":{\"type\":\"string\"},\"type\":\"array\"},\"person_name\":{\"type\":\"string\"},\"address\":{\"\$ref\":\"#/components/schemas/address\",\"type\":\"object\"}},\"type\":\"object\"},\"address\":{\"properties\":{\"zip\":{\"format\":\"int\",\"type\":\"number\"},\"street\":{\"extensions\":{\"x-test-extension-1\":\"hello\",\"x-test-extension-2\":\"world\"},\"type\":\"string\"}},\"type\":\"object\"}}},\"openapi\":\"3.0.0\"}" == schema.definition
38+
"16548065305426330543" == schema.id
3639
shouldExtractPerson
3740
shouldExtractAddress
3841
!shouldExtractPerson2

0 commit comments

Comments
 (0)