(t *testing.T)
| 369 | } |
| 370 | |
| 371 | func TestExtension_JSONRoundTrip_Overrides(t *testing.T) { |
| 372 | resetRegistryForTesting(t) |
| 373 | get := RegisterExtension(&testExtension{}) |
| 374 | |
| 375 | fieldB := 13 |
| 376 | o := Overrides{} |
| 377 | o.Ingestion.MaxLocalTracesPerUser = 777 |
| 378 | o.Extensions = map[string]any{ |
| 379 | "test_extension": &testExtension{FieldA: "json_rt", FieldB: &fieldB}, |
| 380 | } |
| 381 | |
| 382 | b, err := json.Marshal(&o) |
| 383 | require.NoError(t, err) |
| 384 | |
| 385 | var o2 Overrides |
| 386 | require.NoError(t, json.Unmarshal(b, &o2)) |
| 387 | |
| 388 | assert.Equal(t, 777, o2.Ingestion.MaxLocalTracesPerUser) |
| 389 | ext := get(&o2) |
| 390 | require.NotNil(t, ext) |
| 391 | assert.Equal(t, "json_rt", ext.FieldA) |
| 392 | assert.Equal(t, 13, *ext.FieldB) |
| 393 | } |
| 394 | |
| 395 | func TestExtension_LegacyConversionRoundTrip(t *testing.T) { |
| 396 | resetRegistryForTesting(t) |
nothing calls this directly
no test coverage detected