diff --git a/connector/exceptionsconnector/config_test.go b/connector/exceptionsconnector/config_test.go index f128153144b8..cfe8099a692a 100644 --- a/connector/exceptionsconnector/config_test.go +++ b/connector/exceptionsconnector/config_test.go @@ -50,7 +50,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - err = component.UnmarshalConfig(sub, cfg) + err = sub.Unmarshal(cfg) assert.NoError(t, err) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) diff --git a/connector/failoverconnector/config_test.go b/connector/failoverconnector/config_test.go index 4f8a886ca0a3..a07024fe680b 100644 --- a/connector/failoverconnector/config_test.go +++ b/connector/failoverconnector/config_test.go @@ -69,7 +69,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tc.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tc.expected, cfg) @@ -106,7 +106,7 @@ func TestValidateConfig(t *testing.T) { sub, err := cm.Sub(tc.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.EqualError(t, component.ValidateConfig(cfg), tc.err.Error()) }) diff --git a/connector/grafanacloudconnector/config_test.go b/connector/grafanacloudconnector/config_test.go index 9c0a4a6792d4..0a84a7225b5f 100644 --- a/connector/grafanacloudconnector/config_test.go +++ b/connector/grafanacloudconnector/config_test.go @@ -43,7 +43,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, tc.name).String()) assert.NilError(t, err) - assert.NilError(t, component.UnmarshalConfig(sub, cfg)) + assert.NilError(t, sub.Unmarshal(cfg)) assert.DeepEqual(t, tc.expect, cfg) }) } diff --git a/connector/routingconnector/config_test.go b/connector/routingconnector/config_test.go index 350883f38065..9f8b7a94ebf4 100644 --- a/connector/routingconnector/config_test.go +++ b/connector/routingconnector/config_test.go @@ -109,7 +109,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) diff --git a/connector/spanmetricsconnector/config_test.go b/connector/spanmetricsconnector/config_test.go index 117edb58e16d..56f1928338b8 100644 --- a/connector/spanmetricsconnector/config_test.go +++ b/connector/spanmetricsconnector/config_test.go @@ -164,7 +164,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - err = component.UnmarshalConfig(sub, cfg) + err = sub.Unmarshal(cfg) if tt.expected == nil { err = errors.Join(err, component.ValidateConfig(cfg)) diff --git a/exporter/alertmanagerexporter/config_test.go b/exporter/alertmanagerexporter/config_test.go index a31c66fca227..d11d0d3a5e06 100644 --- a/exporter/alertmanagerexporter/config_test.go +++ b/exporter/alertmanagerexporter/config_test.go @@ -89,7 +89,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) diff --git a/exporter/alibabacloudlogserviceexporter/config_test.go b/exporter/alibabacloudlogserviceexporter/config_test.go index 84efa3bad5a5..a9ce04f83909 100644 --- a/exporter/alibabacloudlogserviceexporter/config_test.go +++ b/exporter/alibabacloudlogserviceexporter/config_test.go @@ -53,7 +53,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) diff --git a/exporter/awscloudwatchlogsexporter/config_test.go b/exporter/awscloudwatchlogsexporter/config_test.go index bff0dd70c3af..a806d60eddac 100644 --- a/exporter/awscloudwatchlogsexporter/config_test.go +++ b/exporter/awscloudwatchlogsexporter/config_test.go @@ -96,7 +96,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - err = component.UnmarshalConfig(sub, cfg) + err = sub.Unmarshal(cfg) if tt.expected == nil { err = multierr.Append(err, component.ValidateConfig(cfg)) diff --git a/exporter/awsemfexporter/config_test.go b/exporter/awsemfexporter/config_test.go index 21d664f23d85..8195bcfb70f8 100644 --- a/exporter/awsemfexporter/config_test.go +++ b/exporter/awsemfexporter/config_test.go @@ -113,7 +113,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) diff --git a/exporter/awsemfexporter/factory_test.go b/exporter/awsemfexporter/factory_test.go index d1b71fec7f84..2f39c95411ad 100644 --- a/exporter/awsemfexporter/factory_test.go +++ b/exporter/awsemfexporter/factory_test.go @@ -34,7 +34,7 @@ func TestCreateTracesExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "1").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) ctx := context.Background() exporter, err := factory.CreateTracesExporter(ctx, exportertest.NewNopCreateSettings(), cfg) @@ -50,7 +50,7 @@ func TestCreateMetricsExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "1").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) ctx := context.Background() exporter, err := factory.CreateMetricsExporter(ctx, exportertest.NewNopCreateSettings(), cfg) diff --git a/exporter/awskinesisexporter/config_test.go b/exporter/awskinesisexporter/config_test.go index bc5d78ece97b..579f9a7a635a 100644 --- a/exporter/awskinesisexporter/config_test.go +++ b/exporter/awskinesisexporter/config_test.go @@ -84,7 +84,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) diff --git a/exporter/awsxrayexporter/factory_test.go b/exporter/awsxrayexporter/factory_test.go index 35763d0afaef..0c42e2eb033c 100644 --- a/exporter/awsxrayexporter/factory_test.go +++ b/exporter/awsxrayexporter/factory_test.go @@ -77,7 +77,7 @@ func TestCreateTracesExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "customname").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) ctx := context.Background() exporter, err := factory.CreateTracesExporter(ctx, exportertest.NewNopCreateSettings(), cfg) @@ -93,7 +93,7 @@ func TestCreateMetricsExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "customname").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) ctx := context.Background() exporter, err := factory.CreateMetricsExporter(ctx, exportertest.NewNopCreateSettings(), cfg) diff --git a/exporter/azuredataexplorerexporter/factory_test.go b/exporter/azuredataexplorerexporter/factory_test.go index 3ab968ce0a86..40b6ce2d6186 100644 --- a/exporter/azuredataexplorerexporter/factory_test.go +++ b/exporter/azuredataexplorerexporter/factory_test.go @@ -33,7 +33,7 @@ func TestCreateMetricsExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) params := exportertest.NewNopCreateSettings() exporter, err := factory.CreateMetricsExporter(context.Background(), params, cfg) @@ -63,7 +63,7 @@ func TestCreateMetricsExporterWhenIngestEmpty(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "2").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) params := exportertest.NewNopCreateSettings() // Load the #3 which has empty. This @@ -88,7 +88,7 @@ func TestCreateLogsExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) params := exportertest.NewNopCreateSettings() exporter, err := factory.CreateLogsExporter(context.Background(), params, cfg) @@ -118,7 +118,7 @@ func TestCreateLogsExporterWhenIngestEmpty(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "2").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) params := exportertest.NewNopCreateSettings() // Load the #3 which has empty @@ -136,7 +136,7 @@ func TestCreateTracesExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) params := exportertest.NewNopCreateSettings() exporter, err := factory.CreateTracesExporter(context.Background(), params, cfg) @@ -163,7 +163,7 @@ func TestCreateTracesExporterWhenIngestEmpty(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "2").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) params := exportertest.NewNopCreateSettings() // Load the #3 which has empty diff --git a/exporter/azuremonitorexporter/config_test.go b/exporter/azuremonitorexporter/config_test.go index ba1e41f7fefb..289aa157354f 100644 --- a/exporter/azuremonitorexporter/config_test.go +++ b/exporter/azuremonitorexporter/config_test.go @@ -60,7 +60,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) diff --git a/exporter/carbonexporter/config_test.go b/exporter/carbonexporter/config_test.go index 767908147d08..064e792a9d9b 100644 --- a/exporter/carbonexporter/config_test.go +++ b/exporter/carbonexporter/config_test.go @@ -73,7 +73,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) diff --git a/exporter/cassandraexporter/config_test.go b/exporter/cassandraexporter/config_test.go index 3459addb7548..41799aa6c579 100644 --- a/exporter/cassandraexporter/config_test.go +++ b/exporter/cassandraexporter/config_test.go @@ -46,7 +46,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) diff --git a/exporter/clickhouseexporter/config_test.go b/exporter/clickhouseexporter/config_test.go index d5d8f95cb67d..3f3b27d6ec3a 100644 --- a/exporter/clickhouseexporter/config_test.go +++ b/exporter/clickhouseexporter/config_test.go @@ -86,7 +86,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) @@ -353,7 +353,7 @@ func TestTableEngineConfigParsing(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg.(*Config).TableEngineString()) diff --git a/exporter/coralogixexporter/config_test.go b/exporter/coralogixexporter/config_test.go index 90b0eb28459d..a373213f1b1d 100644 --- a/exporter/coralogixexporter/config_test.go +++ b/exporter/coralogixexporter/config_test.go @@ -156,7 +156,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) @@ -172,7 +172,7 @@ func TestTraceExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) params := exportertest.NewNopCreateSettings() te, err := newTracesExporter(cfg, params) @@ -190,7 +190,7 @@ func TestMetricsExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "metrics").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) require.NoError(t, component.ValidateConfig(cfg)) params := exportertest.NewNopCreateSettings() @@ -210,7 +210,7 @@ func TestLogsExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "logs").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) require.NoError(t, component.ValidateConfig(cfg)) params := exportertest.NewNopCreateSettings() @@ -230,7 +230,7 @@ func TestDomainWithAllExporters(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "domain").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) params := exportertest.NewNopCreateSettings() te, err := newTracesExporter(cfg, params) @@ -260,7 +260,7 @@ func TestEndpoindsAndDomainWithAllExporters(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "domain_endoints").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) params := exportertest.NewNopCreateSettings() te, err := newTracesExporter(cfg, params) diff --git a/exporter/datadogexporter/factory_test.go b/exporter/datadogexporter/factory_test.go index ea0b612b4b14..04bc15ccef6e 100644 --- a/exporter/datadogexporter/factory_test.go +++ b/exporter/datadogexporter/factory_test.go @@ -368,7 +368,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) @@ -459,7 +459,7 @@ func TestOverrideEndpoints(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(component.NewIDWithName(metadata.Type, testInstance.componentID).String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) componentCfg, ok := cfg.(*Config) require.True(t, ok, "component.Config is not a Datadog exporter config (wrong ID?)") @@ -482,7 +482,7 @@ func TestCreateAPIMetricsExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "api").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) c := cfg.(*Config) c.Metrics.TCPAddrConfig.Endpoint = server.URL @@ -515,7 +515,7 @@ func TestCreateAPIExporterFailOnInvalidKey_Zorkian(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "api").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) // Use the mock server for API key validation c := cfg.(*Config) @@ -595,7 +595,7 @@ func TestCreateAPIExporterFailOnInvalidKey(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "api").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) // Use the mock server for API key validation c := cfg.(*Config) @@ -670,7 +670,7 @@ func TestCreateAPILogsExporter(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "api").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) c := cfg.(*Config) c.Metrics.TCPAddrConfig.Endpoint = server.URL @@ -751,7 +751,7 @@ func TestStopExporters(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "api").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) c := cfg.(*Config) c.Metrics.TCPAddrConfig.Endpoint = server.URL diff --git a/receiver/vcenterreceiver/config_test.go b/receiver/vcenterreceiver/config_test.go index 18832d495ac2..e4ce36c3e617 100644 --- a/receiver/vcenterreceiver/config_test.go +++ b/receiver/vcenterreceiver/config_test.go @@ -97,7 +97,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) expected := factory.CreateDefaultConfig().(*Config) expected.Endpoint = "http://vcsa.host.localnet"