From 4dda8b9cb8e6fe5ebbeb479b37889a32375d74f3 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Thu, 6 Jun 2024 02:19:20 -0700 Subject: [PATCH] [chore] remove use of component.UnmarshalConfig (#33407) Description: Remove use of component.UnmarshalConfig this change only affects test code. Follow up to #33404 --------- Co-authored-by: Andrzej Stencel --- connector/countconnector/config_test.go | 2 +- exporter/awsxrayexporter/config_test.go | 2 +- .../azuredataexplorerexporter/config_test.go | 2 +- exporter/datasetexporter/factory_test.go | 2 +- exporter/elasticsearchexporter/config_test.go | 2 +- exporter/fileexporter/config_test.go | 2 +- exporter/googlecloudexporter/config_test.go | 4 +- .../googlecloudpubsubexporter/config_test.go | 4 +- .../honeycombmarkerexporter/config_test.go | 2 +- exporter/influxdbexporter/config_test.go | 2 +- exporter/instanaexporter/factory_test.go | 12 ++--- exporter/kafkaexporter/config_test.go | 2 +- exporter/kineticaexporter/config_test.go | 2 +- exporter/loadbalancingexporter/config_test.go | 2 +- exporter/logicmonitorexporter/config_test.go | 4 +- exporter/logzioexporter/config_test.go | 4 +- exporter/logzioexporter/factory_test.go | 2 +- exporter/lokiexporter/config_test.go | 2 +- exporter/mezmoexporter/config_test.go | 2 +- exporter/opencensusexporter/config_test.go | 2 +- exporter/opensearchexporter/config_test.go | 2 +- exporter/otelarrowexporter/config_test.go | 4 +- exporter/prometheusexporter/config_test.go | 2 +- .../config_test.go | 6 +-- exporter/pulsarexporter/config_test.go | 4 +- exporter/rabbitmqexporter/config_test.go | 2 +- exporter/sapmexporter/config_test.go | 2 +- exporter/sentryexporter/config_test.go | 2 +- exporter/skywalkingexporter/config_test.go | 2 +- exporter/splunkhecexporter/config_test.go | 2 +- .../config_test.go | 2 +- exporter/zipkinexporter/config_test.go | 2 +- extension/asapauthextension/config_test.go | 2 +- extension/awsproxy/config_test.go | 2 +- extension/basicauthextension/config_test.go | 2 +- .../bearertokenauthextension/config_test.go | 2 +- .../googleclientauthextension/config_test.go | 4 +- .../headerssetterextension/config_test.go | 2 +- extension/healthcheckextension/config_test.go | 2 +- .../healthcheckv2extension/config_test.go | 2 +- .../httpforwarderextension/config_test.go | 2 +- extension/jaegerremotesampling/config_test.go | 2 +- .../oauth2clientauthextension/config_test.go | 2 +- .../observer/dockerobserver/config_test.go | 2 +- extension/observer/ecsobserver/config_test.go | 2 +- .../observer/ecstaskobserver/config_test.go | 2 +- .../observer/hostobserver/config_test.go | 2 +- extension/observer/k8sobserver/config_test.go | 2 +- extension/opampextension/config_test.go | 7 ++- extension/pprofextension/config_test.go | 2 +- extension/sigv4authextension/config_test.go | 4 +- .../config_test.go | 2 +- extension/storage/filestorage/config_test.go | 2 +- pkg/stanza/operator/operatortest/confmap.go | 3 +- processor/attributesprocessor/config_test.go | 2 +- .../cumulativetodeltaprocessor/config_test.go | 2 +- .../factory_test.go | 3 +- .../deltatocumulativeprocessor/config_test.go | 2 +- processor/deltatorateprocessor/config_test.go | 2 +- .../deltatorateprocessor/factory_test.go | 3 +- processor/filterprocessor/config_test.go | 22 ++++----- processor/filterprocessor/factory_test.go | 3 +- processor/geoipprocessor/config_test.go | 2 +- .../groupbyattrsprocessor/config_test.go | 2 +- .../k8sattributesprocessor/config_test.go | 2 +- .../logstransformprocessor/config_test.go | 3 +- .../metricsgenerationprocessor/config_test.go | 2 +- .../factory_test.go | 3 +- .../metricstransformprocessor/config_test.go | 2 +- .../metricstransformprocessor/factory_test.go | 3 +- .../config_test.go | 2 +- processor/redactionprocessor/config_test.go | 2 +- .../resourcedetectionprocessor/config_test.go | 2 +- .../factory_test.go | 3 +- processor/resourceprocessor/config_test.go | 2 +- processor/routingprocessor/config_test.go | 2 +- processor/routingprocessor/factory_test.go | 2 +- processor/schemaprocessor/config_test.go | 2 +- processor/spanprocessor/config_test.go | 2 +- .../tailsamplingprocessor/config_test.go | 2 +- .../tailsamplingprocessor/factory_test.go | 2 +- processor/transformprocessor/config_test.go | 6 +-- .../activedirectorydsreceiver/config_test.go | 2 +- receiver/aerospikereceiver/config_test.go | 2 +- receiver/apachereceiver/config_test.go | 2 +- receiver/awscloudwatchreceiver/config_test.go | 2 +- .../config_test.go | 2 +- .../config_test.go | 2 +- receiver/awsfirehosereceiver/config_test.go | 2 +- receiver/awss3receiver/config_test.go | 2 +- receiver/awsxrayreceiver/config_test.go | 2 +- .../internal/metadata/metrics_test.go | 3 +- receiver/bigipreceiver/config_test.go | 2 +- receiver/carbonreceiver/config_test.go | 2 +- receiver/chronyreceiver/config_test.go | 2 +- receiver/cloudflarereceiver/config_test.go | 2 +- receiver/cloudfoundryreceiver/config_test.go | 2 +- receiver/collectdreceiver/config_test.go | 2 +- receiver/couchdbreceiver/config_test.go | 2 +- receiver/dockerstatsreceiver/config_test.go | 2 +- receiver/elasticsearchreceiver/config_test.go | 2 +- receiver/expvarreceiver/config_test.go | 2 +- receiver/filelogreceiver/filelog_test.go | 2 +- receiver/flinkmetricsreceiver/config_test.go | 2 +- receiver/fluentforwardreceiver/config_test.go | 2 +- .../googlecloudpubsubreceiver/config_test.go | 2 +- .../googlecloudspannerreceiver/config_test.go | 2 +- receiver/jaegerreceiver/config_test.go | 8 ++-- receiver/jaegerreceiver/factory_test.go | 2 +- receiver/jmxreceiver/config_test.go | 4 +- receiver/journaldreceiver/journald_test.go | 2 +- receiver/k8sclusterreceiver/config_test.go | 2 +- receiver/k8seventsreceiver/config_test.go | 2 +- receiver/k8sobjectsreceiver/config_test.go | 2 +- receiver/kafkametricsreceiver/config_test.go | 2 +- receiver/kafkareceiver/config_test.go | 2 +- receiver/kubeletstatsreceiver/config_test.go | 2 +- receiver/lokireceiver/config_test.go | 6 +-- receiver/memcachedreceiver/config_test.go | 2 +- receiver/mongodbatlasreceiver/config_test.go | 2 +- receiver/mongodbreceiver/config_test.go | 2 +- receiver/mysqlreceiver/config_test.go | 4 +- receiver/namedpipereceiver/namedpipe_test.go | 2 +- receiver/nginxreceiver/config_test.go | 2 +- receiver/nsxtreceiver/config_test.go | 2 +- receiver/opencensusreceiver/config_test.go | 2 +- receiver/oracledbreceiver/config_test.go | 3 +- receiver/otelarrowreceiver/config_test.go | 12 ++--- receiver/otlpjsonfilereceiver/file_test.go | 2 +- receiver/podmanreceiver/config_test.go | 2 +- receiver/postgresqlreceiver/config_test.go | 6 +-- receiver/prometheusreceiver/config_test.go | 46 +++++++++---------- receiver/prometheusreceiver/factory_test.go | 2 +- receiver/pulsarreceiver/config_test.go | 2 +- receiver/purefareceiver/config_test.go | 2 +- receiver/purefbreceiver/config_test.go | 2 +- receiver/rabbitmqreceiver/config_test.go | 2 +- receiver/receivercreator/config_test.go | 2 +- receiver/receivercreator/receiver_test.go | 2 +- receiver/receivercreator/runner.go | 2 +- receiver/redisreceiver/config_test.go | 2 +- receiver/saphanareceiver/config_test.go | 2 +- receiver/sapmreceiver/config_test.go | 2 +- receiver/signalfxreceiver/config_test.go | 2 +- .../simpleprometheusreceiver/config_test.go | 2 +- receiver/skywalkingreceiver/config_test.go | 2 +- receiver/skywalkingreceiver/factory_test.go | 2 +- receiver/snmpreceiver/config_test.go | 4 +- receiver/snowflakereceiver/config_test.go | 2 +- receiver/solacereceiver/config_test.go | 2 +- receiver/solacereceiver/factory_test.go | 4 +- receiver/splunkhecreceiver/config_test.go | 2 +- receiver/sqlqueryreceiver/config_test.go | 4 +- receiver/sqlserverreceiver/config_test.go | 4 +- receiver/statsdreceiver/config_test.go | 2 +- receiver/syslogreceiver/syslog_test.go | 2 +- receiver/tcplogreceiver/tcp_test.go | 2 +- receiver/udplogreceiver/udp_test.go | 2 +- receiver/wavefrontreceiver/config_test.go | 2 +- receiver/webhookeventreceiver/config_test.go | 2 +- .../receiver_windows_test.go | 2 +- .../config_test.go | 2 +- receiver/zipkinreceiver/config_test.go | 2 +- 163 files changed, 232 insertions(+), 243 deletions(-) diff --git a/connector/countconnector/config_test.go b/connector/countconnector/config_test.go index c19fef80ff4a..02f9a1a1104c 100644 --- a/connector/countconnector/config_test.go +++ b/connector/countconnector/config_test.go @@ -382,7 +382,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, tc.name).String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.Equal(t, tc.expect, cfg) }) diff --git a/exporter/awsxrayexporter/config_test.go b/exporter/awsxrayexporter/config_test.go index d4e232de4451..ce11f651eee5 100644 --- a/exporter/awsxrayexporter/config_test.go +++ b/exporter/awsxrayexporter/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/azuredataexplorerexporter/config_test.go b/exporter/azuredataexplorerexporter/config_test.go index 2c6667c3db61..10b28f686fc2 100644 --- a/exporter/azuredataexplorerexporter/config_test.go +++ b/exporter/azuredataexplorerexporter/config_test.go @@ -120,7 +120,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)) if tt.expected == nil { assert.EqualError(t, component.ValidateConfig(cfg), tt.errorMessage) diff --git a/exporter/datasetexporter/factory_test.go b/exporter/datasetexporter/factory_test.go index 3168a0efb47a..0599415d1329 100644 --- a/exporter/datasetexporter/factory_test.go +++ b/exporter/datasetexporter/factory_test.go @@ -145,7 +145,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.Nil(t, component.UnmarshalConfig(sub, cfg)) + require.Nil(t, sub.Unmarshal(cfg)) if assert.Nil(t, component.ValidateConfig(cfg)) { assert.Equal(t, tt.expected, cfg) } diff --git a/exporter/elasticsearchexporter/config_test.go b/exporter/elasticsearchexporter/config_test.go index 021eeceb9095..933cf2fba564 100644 --- a/exporter/elasticsearchexporter/config_test.go +++ b/exporter/elasticsearchexporter/config_test.go @@ -179,7 +179,7 @@ func TestConfig(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/fileexporter/config_test.go b/exporter/fileexporter/config_test.go index 2e588047406e..675e8b7b3e9f 100644 --- a/exporter/fileexporter/config_test.go +++ b/exporter/fileexporter/config_test.go @@ -194,7 +194,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)) if tt.expected == nil { assert.EqualError(t, component.ValidateConfig(cfg), tt.errorMessage) diff --git a/exporter/googlecloudexporter/config_test.go b/exporter/googlecloudexporter/config_test.go index 748100efb56a..106a130d7c66 100644 --- a/exporter/googlecloudexporter/config_test.go +++ b/exporter/googlecloudexporter/config_test.go @@ -26,13 +26,13 @@ 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)) assert.Equal(t, sanitize(cfg.(*Config)), sanitize(factory.CreateDefaultConfig().(*Config))) 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)) assert.Equal(t, &Config{ diff --git a/exporter/googlecloudpubsubexporter/config_test.go b/exporter/googlecloudpubsubexporter/config_test.go index e50197eebbae..cdbb948ca8f9 100644 --- a/exporter/googlecloudpubsubexporter/config_test.go +++ b/exporter/googlecloudpubsubexporter/config_test.go @@ -25,14 +25,14 @@ 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)) defaultConfig := factory.CreateDefaultConfig().(*Config) assert.Equal(t, cfg, defaultConfig) 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)) customConfig := factory.CreateDefaultConfig().(*Config) diff --git a/exporter/honeycombmarkerexporter/config_test.go b/exporter/honeycombmarkerexporter/config_test.go index df0298fb98eb..ac34ff3d6985 100644 --- a/exporter/honeycombmarkerexporter/config_test.go +++ b/exporter/honeycombmarkerexporter/config_test.go @@ -87,7 +87,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)) if tt.expected == nil { err = component.ValidateConfig(cfg) diff --git a/exporter/influxdbexporter/config_test.go b/exporter/influxdbexporter/config_test.go index ea8f355e69b5..baad494b6285 100644 --- a/exporter/influxdbexporter/config_test.go +++ b/exporter/influxdbexporter/config_test.go @@ -75,7 +75,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/instanaexporter/factory_test.go b/exporter/instanaexporter/factory_test.go index 2829f93112e9..e610e6498e40 100644 --- a/exporter/instanaexporter/factory_test.go +++ b/exporter/instanaexporter/factory_test.go @@ -47,7 +47,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "valid").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) err = component.ValidateConfig(cfg) @@ -68,7 +68,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "valid_with_ca_file").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) err = component.ValidateConfig(cfg) @@ -94,7 +94,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "valid_no_ca_file").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) err = component.ValidateConfig(cfg) @@ -115,7 +115,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "bad_endpoint").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) err = component.ValidateConfig(cfg) require.Error(t, err) @@ -126,7 +126,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "non_https_endpoint").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) err = component.ValidateConfig(cfg) require.Error(t, err) @@ -136,7 +136,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "missing_agent_key").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) err = component.ValidateConfig(cfg) require.Error(t, err) diff --git a/exporter/kafkaexporter/config_test.go b/exporter/kafkaexporter/config_test.go index 4b43f948ebe3..236125c3db35 100644 --- a/exporter/kafkaexporter/config_test.go +++ b/exporter/kafkaexporter/config_test.go @@ -199,7 +199,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/kineticaexporter/config_test.go b/exporter/kineticaexporter/config_test.go index 8d5517b78e92..997ea5b5dbf4 100644 --- a/exporter/kineticaexporter/config_test.go +++ b/exporter/kineticaexporter/config_test.go @@ -41,7 +41,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/loadbalancingexporter/config_test.go b/exporter/loadbalancingexporter/config_test.go index 71d9ed01905e..c34644174d08 100644 --- a/exporter/loadbalancingexporter/config_test.go +++ b/exporter/loadbalancingexporter/config_test.go @@ -22,6 +22,6 @@ 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)) require.NotNil(t, cfg) } diff --git a/exporter/logicmonitorexporter/config_test.go b/exporter/logicmonitorexporter/config_test.go index 2e9cf01edca7..ea0d7784c11e 100644 --- a/exporter/logicmonitorexporter/config_test.go +++ b/exporter/logicmonitorexporter/config_test.go @@ -151,7 +151,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) @@ -181,7 +181,7 @@ func TestUnmarshal(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { cfg := f.CreateDefaultConfig().(*Config) - err := component.UnmarshalConfig(tt.configMap, cfg) + err := tt.configMap.Unmarshal(cfg) if err != nil || tt.err != "" { assert.EqualError(t, err, tt.err) } else { diff --git a/exporter/logzioexporter/config_test.go b/exporter/logzioexporter/config_test.go index a85ca894239d..5b1cc56739b6 100644 --- a/exporter/logzioexporter/config_test.go +++ b/exporter/logzioexporter/config_test.go @@ -30,7 +30,7 @@ func TestLoadConfig(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)) expected := &Config{ Token: "token", @@ -60,7 +60,7 @@ func TestDefaultLoadConfig(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)) expected := &Config{ Token: "logzioTESTtoken", diff --git a/exporter/logzioexporter/factory_test.go b/exporter/logzioexporter/factory_test.go index 60624fa977cd..2ec14e664172 100644 --- a/exporter/logzioexporter/factory_test.go +++ b/exporter/logzioexporter/factory_test.go @@ -34,7 +34,7 @@ func TestCreateTracesExporter(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() exporter, err := factory.CreateTracesExporter(context.Background(), params, cfg) diff --git a/exporter/lokiexporter/config_test.go b/exporter/lokiexporter/config_test.go index dfdda9c34e26..242cc2d3e970 100644 --- a/exporter/lokiexporter/config_test.go +++ b/exporter/lokiexporter/config_test.go @@ -83,7 +83,7 @@ func TestLoadConfigNewExporter(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/mezmoexporter/config_test.go b/exporter/mezmoexporter/config_test.go index 953ea71aa778..75a3607a4f82 100644 --- a/exporter/mezmoexporter/config_test.go +++ b/exporter/mezmoexporter/config_test.go @@ -70,7 +70,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/opencensusexporter/config_test.go b/exporter/opencensusexporter/config_test.go index 323fdd64ed11..e60fbd9a13fd 100644 --- a/exporter/opencensusexporter/config_test.go +++ b/exporter/opencensusexporter/config_test.go @@ -83,7 +83,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/opensearchexporter/config_test.go b/exporter/opensearchexporter/config_test.go index 68d9abd6b681..142a1b819a03 100644 --- a/exporter/opensearchexporter/config_test.go +++ b/exporter/opensearchexporter/config_test.go @@ -115,7 +115,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)) vv := component.ValidateConfig(cfg) tt.configValidateAssert(t, vv) diff --git a/exporter/otelarrowexporter/config_test.go b/exporter/otelarrowexporter/config_test.go index b1a6253837df..b193a31667e9 100644 --- a/exporter/otelarrowexporter/config_test.go +++ b/exporter/otelarrowexporter/config_test.go @@ -31,7 +31,7 @@ func TestUnmarshalDefaultConfig(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.NoError(t, cm.Unmarshal(cfg)) assert.Equal(t, factory.CreateDefaultConfig(), cfg) assert.Equal(t, "round_robin", cfg.(*Config).ClientConfig.BalancerName) assert.Equal(t, arrow.DefaultPrioritizer, cfg.(*Config).Arrow.Prioritizer) @@ -42,7 +42,7 @@ func TestUnmarshalConfig(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.NoError(t, cm.Unmarshal(cfg)) assert.Equal(t, &Config{ TimeoutSettings: exporterhelper.TimeoutSettings{ diff --git a/exporter/prometheusexporter/config_test.go b/exporter/prometheusexporter/config_test.go index 05c465288e41..c0d8b0ff1dc7 100644 --- a/exporter/prometheusexporter/config_test.go +++ b/exporter/prometheusexporter/config_test.go @@ -64,7 +64,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/prometheusremotewriteexporter/config_test.go b/exporter/prometheusremotewriteexporter/config_test.go index 00e6074eda19..1057b0d0ebc8 100644 --- a/exporter/prometheusremotewriteexporter/config_test.go +++ b/exporter/prometheusremotewriteexporter/config_test.go @@ -98,7 +98,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)) if tt.expected == nil { assert.EqualError(t, component.ValidateConfig(cfg), tt.errorMessage) @@ -118,7 +118,7 @@ func TestDisabledQueue(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "disabled_queue").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.False(t, cfg.(*Config).RemoteWriteQueue.Enabled) } @@ -131,7 +131,7 @@ func TestDisabledTargetInfo(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "disabled_target_info").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.False(t, cfg.(*Config).TargetInfo.Enabled) } diff --git a/exporter/pulsarexporter/config_test.go b/exporter/pulsarexporter/config_test.go index bd43784cc546..048878af5e41 100644 --- a/exporter/pulsarexporter/config_test.go +++ b/exporter/pulsarexporter/config_test.go @@ -82,7 +82,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) @@ -98,7 +98,7 @@ func TestClientOptions(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)) options := cfg.(*Config).clientOptions() diff --git a/exporter/rabbitmqexporter/config_test.go b/exporter/rabbitmqexporter/config_test.go index 1c82b113f1bd..503d971a300a 100644 --- a/exporter/rabbitmqexporter/config_test.go +++ b/exporter/rabbitmqexporter/config_test.go @@ -104,7 +104,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)) if tt.expected == nil { err = errors.Join(err, component.ValidateConfig(cfg)) diff --git a/exporter/sapmexporter/config_test.go b/exporter/sapmexporter/config_test.go index baf3e96463d6..06007a91f5d8 100644 --- a/exporter/sapmexporter/config_test.go +++ b/exporter/sapmexporter/config_test.go @@ -76,7 +76,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/sentryexporter/config_test.go b/exporter/sentryexporter/config_test.go index 14563ed1373b..3769b1f1ca95 100644 --- a/exporter/sentryexporter/config_test.go +++ b/exporter/sentryexporter/config_test.go @@ -45,7 +45,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/skywalkingexporter/config_test.go b/exporter/skywalkingexporter/config_test.go index 5f28d24bccb9..05a5877f35e0 100644 --- a/exporter/skywalkingexporter/config_test.go +++ b/exporter/skywalkingexporter/config_test.go @@ -92,7 +92,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/splunkhecexporter/config_test.go b/exporter/splunkhecexporter/config_test.go index 5fcfd021cd18..5d369d6ac9cc 100644 --- a/exporter/splunkhecexporter/config_test.go +++ b/exporter/splunkhecexporter/config_test.go @@ -137,7 +137,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/tencentcloudlogserviceexporter/config_test.go b/exporter/tencentcloudlogserviceexporter/config_test.go index bf91735835bb..0136ab86923a 100644 --- a/exporter/tencentcloudlogserviceexporter/config_test.go +++ b/exporter/tencentcloudlogserviceexporter/config_test.go @@ -44,7 +44,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/zipkinexporter/config_test.go b/exporter/zipkinexporter/config_test.go index db89e0619f7a..a27c6c7ae8e4 100644 --- a/exporter/zipkinexporter/config_test.go +++ b/exporter/zipkinexporter/config_test.go @@ -80,7 +80,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/extension/asapauthextension/config_test.go b/extension/asapauthextension/config_test.go index 4ac3950f4f40..e92a2636990f 100644 --- a/extension/asapauthextension/config_test.go +++ b/extension/asapauthextension/config_test.go @@ -69,7 +69,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if tt.expectedErr != nil { assert.ErrorIs(t, component.ValidateConfig(cfg), tt.expectedErr) return diff --git a/extension/awsproxy/config_test.go b/extension/awsproxy/config_test.go index a6171a652990..9c105525a819 100644 --- a/extension/awsproxy/config_test.go +++ b/extension/awsproxy/config_test.go @@ -57,7 +57,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() 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/extension/basicauthextension/config_test.go b/extension/basicauthextension/config_test.go index c2dfa6f0f5fa..cd2d843f0afe 100644 --- a/extension/basicauthextension/config_test.go +++ b/extension/basicauthextension/config_test.go @@ -57,7 +57,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if tt.expectedErr { assert.Error(t, component.ValidateConfig(cfg)) return diff --git a/extension/bearertokenauthextension/config_test.go b/extension/bearertokenauthextension/config_test.go index 5143bf6bd60b..d739fcf86825 100644 --- a/extension/bearertokenauthextension/config_test.go +++ b/extension/bearertokenauthextension/config_test.go @@ -50,7 +50,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if tt.expectedErr { assert.Error(t, component.ValidateConfig(cfg)) return diff --git a/extension/googleclientauthextension/config_test.go b/extension/googleclientauthextension/config_test.go index f5106f3ae7ea..b72c6cdfc411 100644 --- a/extension/googleclientauthextension/config_test.go +++ b/extension/googleclientauthextension/config_test.go @@ -24,13 +24,13 @@ 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)) assert.Equal(t, cfg.(*Config), factory.CreateDefaultConfig().(*Config)) 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)) assert.Equal(t, &Config{ Config: googleclientauthextension.Config{ diff --git a/extension/headerssetterextension/config_test.go b/extension/headerssetterextension/config_test.go index 2403c919f01f..9fab6b3d0327 100644 --- a/extension/headerssetterextension/config_test.go +++ b/extension/headerssetterextension/config_test.go @@ -66,7 +66,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)) if tt.expectedError != nil { assert.Error(t, component.ValidateConfig(cfg), tt.expectedError) diff --git a/extension/healthcheckextension/config_test.go b/extension/healthcheckextension/config_test.go index 2b9515b95f27..ba4fb69d0fb2 100644 --- a/extension/healthcheckextension/config_test.go +++ b/extension/healthcheckextension/config_test.go @@ -68,7 +68,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if tt.expectedErr != nil { assert.ErrorIs(t, component.ValidateConfig(cfg), tt.expectedErr) return diff --git a/extension/healthcheckv2extension/config_test.go b/extension/healthcheckv2extension/config_test.go index c1a0a06cf369..f9e141eb8e48 100644 --- a/extension/healthcheckv2extension/config_test.go +++ b/extension/healthcheckv2extension/config_test.go @@ -180,7 +180,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if tt.expectedErr != nil { assert.ErrorIs(t, component.ValidateConfig(cfg), tt.expectedErr) return diff --git a/extension/httpforwarderextension/config_test.go b/extension/httpforwarderextension/config_test.go index 9837e27f84bc..f6256b7867c6 100644 --- a/extension/httpforwarderextension/config_test.go +++ b/extension/httpforwarderextension/config_test.go @@ -57,7 +57,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() 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/extension/jaegerremotesampling/config_test.go b/extension/jaegerremotesampling/config_test.go index cd9ef017e888..4dcd99f27e18 100644 --- a/extension/jaegerremotesampling/config_test.go +++ b/extension/jaegerremotesampling/config_test.go @@ -64,7 +64,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() 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/extension/oauth2clientauthextension/config_test.go b/extension/oauth2clientauthextension/config_test.go index 2d2a9b73fa84..29bb97401169 100644 --- a/extension/oauth2clientauthextension/config_test.go +++ b/extension/oauth2clientauthextension/config_test.go @@ -78,7 +78,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if tt.expectedErr != nil { assert.ErrorIs(t, component.ValidateConfig(cfg), tt.expectedErr) return diff --git a/extension/observer/dockerobserver/config_test.go b/extension/observer/dockerobserver/config_test.go index 45c47720e063..bc6e0a971d12 100644 --- a/extension/observer/dockerobserver/config_test.go +++ b/extension/observer/dockerobserver/config_test.go @@ -91,7 +91,7 @@ func loadConfig(t testing.TB, id component.ID) *Config { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) return cfg.(*Config) } diff --git a/extension/observer/ecsobserver/config_test.go b/extension/observer/ecsobserver/config_test.go index eef16a735570..c838cea10edf 100644 --- a/extension/observer/ecsobserver/config_test.go +++ b/extension/observer/ecsobserver/config_test.go @@ -65,7 +65,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if tt.expectedErr { assert.Error(t, component.ValidateConfig(cfg)) return diff --git a/extension/observer/ecstaskobserver/config_test.go b/extension/observer/ecstaskobserver/config_test.go index 4a9da20bf93b..e28ae3af9c7b 100644 --- a/extension/observer/ecstaskobserver/config_test.go +++ b/extension/observer/ecstaskobserver/config_test.go @@ -59,7 +59,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if tt.expectedErr != "" { assert.EqualError(t, component.ValidateConfig(cfg), tt.expectedErr) return diff --git a/extension/observer/hostobserver/config_test.go b/extension/observer/hostobserver/config_test.go index 215beed4e86a..12f04b01a925 100644 --- a/extension/observer/hostobserver/config_test.go +++ b/extension/observer/hostobserver/config_test.go @@ -42,7 +42,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() 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/extension/observer/k8sobserver/config_test.go b/extension/observer/k8sobserver/config_test.go index 20f29407a4da..551303679508 100644 --- a/extension/observer/k8sobserver/config_test.go +++ b/extension/observer/k8sobserver/config_test.go @@ -63,7 +63,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if tt.expectedErr != "" { assert.EqualError(t, component.ValidateConfig(cfg), tt.expectedErr) return diff --git a/extension/opampextension/config_test.go b/extension/opampextension/config_test.go index 5702e3fa0f32..7c996f53b7e8 100644 --- a/extension/opampextension/config_test.go +++ b/extension/opampextension/config_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configopaque" "go.opentelemetry.io/collector/config/configtls" "go.opentelemetry.io/collector/confmap" @@ -20,7 +19,7 @@ import ( func TestUnmarshalDefaultConfig(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.NoError(t, component.UnmarshalConfig(confmap.New(), cfg)) + assert.NoError(t, confmap.New().Unmarshal(cfg)) assert.Equal(t, factory.CreateDefaultConfig(), cfg) } @@ -29,7 +28,7 @@ func TestUnmarshalConfig(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.NoError(t, cm.Unmarshal(cfg)) assert.Equal(t, &Config{ Server: &OpAMPServer{ @@ -50,7 +49,7 @@ func TestUnmarshalHttpConfig(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.NoError(t, cm.Unmarshal(cfg)) assert.Equal(t, &Config{ Server: &OpAMPServer{ diff --git a/extension/pprofextension/config_test.go b/extension/pprofextension/config_test.go index b3086a366ef1..a46d009b4c49 100644 --- a/extension/pprofextension/config_test.go +++ b/extension/pprofextension/config_test.go @@ -44,7 +44,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() 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/extension/sigv4authextension/config_test.go b/extension/sigv4authextension/config_test.go index 803ccce400bc..c5a473c11f0b 100644 --- a/extension/sigv4authextension/config_test.go +++ b/extension/sigv4authextension/config_test.go @@ -29,7 +29,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(component.NewID(metadata.Type).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, &Config{ @@ -51,6 +51,6 @@ func TestLoadConfigError(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "missing_credentials").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.Error(t, component.ValidateConfig(cfg)) } diff --git a/extension/solarwindsapmsettingsextension/config_test.go b/extension/solarwindsapmsettingsextension/config_test.go index f87fc59c2353..a6814ec5b83e 100644 --- a/extension/solarwindsapmsettingsextension/config_test.go +++ b/extension/solarwindsapmsettingsextension/config_test.go @@ -61,7 +61,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() 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/extension/storage/filestorage/config_test.go b/extension/storage/filestorage/config_test.go index 67decc8dbed5..025bc0eecdb9 100644 --- a/extension/storage/filestorage/config_test.go +++ b/extension/storage/filestorage/config_test.go @@ -60,7 +60,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() 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/pkg/stanza/operator/operatortest/confmap.go b/pkg/stanza/operator/operatortest/confmap.go index f5ce8b4c9f31..8fc5e98113c9 100644 --- a/pkg/stanza/operator/operatortest/confmap.go +++ b/pkg/stanza/operator/operatortest/confmap.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/confmap/confmaptest" @@ -41,7 +40,7 @@ func (c ConfigUnmarshalTests) Run(t *testing.T) { require.NotZero(t, len(testConfMap.AllKeys()), fmt.Sprintf("config not found: '%s'", tc.Name)) cfg := newAnyOpConfig(c.DefaultConfig) - err = component.UnmarshalConfig(testConfMap, cfg) + err = testConfMap.Unmarshal(cfg) if tc.ExpectErr { require.Error(t, err) diff --git a/processor/attributesprocessor/config_test.go b/processor/attributesprocessor/config_test.go index d2b3208db6bc..bb37cab77391 100644 --- a/processor/attributesprocessor/config_test.go +++ b/processor/attributesprocessor/config_test.go @@ -209,7 +209,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/processor/cumulativetodeltaprocessor/config_test.go b/processor/cumulativetodeltaprocessor/config_test.go index a915bebbeec4..97c3f8952077 100644 --- a/processor/cumulativetodeltaprocessor/config_test.go +++ b/processor/cumulativetodeltaprocessor/config_test.go @@ -120,7 +120,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)) if tt.expected == nil { assert.EqualError(t, component.ValidateConfig(cfg), tt.errorMessage) diff --git a/processor/cumulativetodeltaprocessor/factory_test.go b/processor/cumulativetodeltaprocessor/factory_test.go index 01cd92a35474..54c4db26ccfe 100644 --- a/processor/cumulativetodeltaprocessor/factory_test.go +++ b/processor/cumulativetodeltaprocessor/factory_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" @@ -46,7 +45,7 @@ func TestCreateProcessors(t *testing.T) { sub, err := cm.Sub(k) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) tp, tErr := factory.CreateTracesProcessor( context.Background(), diff --git a/processor/deltatocumulativeprocessor/config_test.go b/processor/deltatocumulativeprocessor/config_test.go index 79348b2aa6a7..cbda97e2672d 100644 --- a/processor/deltatocumulativeprocessor/config_test.go +++ b/processor/deltatocumulativeprocessor/config_test.go @@ -56,7 +56,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/processor/deltatorateprocessor/config_test.go b/processor/deltatorateprocessor/config_test.go index c23b912f0bf9..05a1cb797db4 100644 --- a/processor/deltatorateprocessor/config_test.go +++ b/processor/deltatorateprocessor/config_test.go @@ -48,7 +48,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)) if tt.expected == nil { assert.EqualError(t, component.ValidateConfig(cfg), tt.errorMessage) diff --git a/processor/deltatorateprocessor/factory_test.go b/processor/deltatorateprocessor/factory_test.go index 5b1f0c24cc9a..3f05d5658c04 100644 --- a/processor/deltatorateprocessor/factory_test.go +++ b/processor/deltatorateprocessor/factory_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" @@ -46,7 +45,7 @@ func TestCreateProcessors(t *testing.T) { sub, err := cm.Sub(k) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) tp, tErr := factory.CreateTracesProcessor( context.Background(), diff --git a/processor/filterprocessor/config_test.go b/processor/filterprocessor/config_test.go index 9ebf9ee47cba..eda1d7cec90e 100644 --- a/processor/filterprocessor/config_test.go +++ b/processor/filterprocessor/config_test.go @@ -87,7 +87,7 @@ func TestLoadingConfigStrict(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) @@ -170,7 +170,7 @@ func TestLoadingConfigStrictLogs(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) @@ -233,7 +233,7 @@ func TestLoadingConfigSeverityLogsStrict(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) @@ -295,7 +295,7 @@ func TestLoadingConfigSeverityLogsRegexp(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) @@ -358,7 +358,7 @@ func TestLoadingConfigBodyLogsStrict(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) @@ -421,7 +421,7 @@ func TestLoadingConfigBodyLogsRegexp(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) @@ -486,7 +486,7 @@ func TestLoadingConfigMinSeverityNumberLogs(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) @@ -575,7 +575,7 @@ func TestLoadingConfigRegexp(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) @@ -625,7 +625,7 @@ func TestLoadingSpans(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) @@ -710,7 +710,7 @@ func TestLoadingConfigExpr(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) @@ -916,7 +916,7 @@ func TestLoadingConfigOTTL(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)) if tt.expected == nil { if tt.errorMessage != "" { diff --git a/processor/filterprocessor/factory_test.go b/processor/filterprocessor/factory_test.go index 6a241a1e289a..82c0e7dcbe92 100644 --- a/processor/filterprocessor/factory_test.go +++ b/processor/filterprocessor/factory_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" @@ -86,7 +85,7 @@ func TestCreateProcessors(t *testing.T) { sub, err := cm.Sub(k) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) tp, tErr := factory.CreateTracesProcessor( context.Background(), diff --git a/processor/geoipprocessor/config_test.go b/processor/geoipprocessor/config_test.go index 7714a7587d6e..933f1dc86acd 100644 --- a/processor/geoipprocessor/config_test.go +++ b/processor/geoipprocessor/config_test.go @@ -39,7 +39,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)) if tt.errorMessage != "" { assert.EqualError(t, component.ValidateConfig(cfg), tt.errorMessage) diff --git a/processor/groupbyattrsprocessor/config_test.go b/processor/groupbyattrsprocessor/config_test.go index 24395a09ad88..e5fd565797ed 100644 --- a/processor/groupbyattrsprocessor/config_test.go +++ b/processor/groupbyattrsprocessor/config_test.go @@ -46,7 +46,7 @@ func TestLoadingConfig(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/processor/k8sattributesprocessor/config_test.go b/processor/k8sattributesprocessor/config_test.go index 9ec78ede8856..cece8a3e1260 100644 --- a/processor/k8sattributesprocessor/config_test.go +++ b/processor/k8sattributesprocessor/config_test.go @@ -184,7 +184,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)) if tt.expected == nil { err = component.ValidateConfig(cfg) diff --git a/processor/logstransformprocessor/config_test.go b/processor/logstransformprocessor/config_test.go index c81d782bc550..866f8f2c7048 100644 --- a/processor/logstransformprocessor/config_test.go +++ b/processor/logstransformprocessor/config_test.go @@ -9,7 +9,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap/confmaptest" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter" @@ -24,7 +23,7 @@ func TestLoadConfig(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.NoError(t, cm.Unmarshal(cfg)) assert.Equal(t, &Config{ BaseConfig: adapter.BaseConfig{ Operators: []operator.Config{ diff --git a/processor/metricsgenerationprocessor/config_test.go b/processor/metricsgenerationprocessor/config_test.go index aa6aa6afffc7..04e98ab7a433 100644 --- a/processor/metricsgenerationprocessor/config_test.go +++ b/processor/metricsgenerationprocessor/config_test.go @@ -86,7 +86,7 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if tt.expected == nil { assert.EqualError(t, component.ValidateConfig(cfg), tt.errorMessage) diff --git a/processor/metricsgenerationprocessor/factory_test.go b/processor/metricsgenerationprocessor/factory_test.go index d09c80028e93..b36f5190d640 100644 --- a/processor/metricsgenerationprocessor/factory_test.go +++ b/processor/metricsgenerationprocessor/factory_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" @@ -47,7 +46,7 @@ func TestCreateProcessors(t *testing.T) { sub, err := cm.Sub(k) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) tp, tErr := factory.CreateTracesProcessor( context.Background(), diff --git a/processor/metricstransformprocessor/config_test.go b/processor/metricstransformprocessor/config_test.go index 0433fd785037..54d00d4df829 100644 --- a/processor/metricstransformprocessor/config_test.go +++ b/processor/metricstransformprocessor/config_test.go @@ -154,7 +154,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/processor/metricstransformprocessor/factory_test.go b/processor/metricstransformprocessor/factory_test.go index 0f0b4632373e..fea56636815a 100644 --- a/processor/metricstransformprocessor/factory_test.go +++ b/processor/metricstransformprocessor/factory_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" @@ -119,7 +118,7 @@ func TestCreateProcessors(t *testing.T) { sub, err := cm.Sub(k) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) tp, tErr := factory.CreateTracesProcessor( context.Background(), diff --git a/processor/probabilisticsamplerprocessor/config_test.go b/processor/probabilisticsamplerprocessor/config_test.go index d236c519c53d..3200f049569d 100644 --- a/processor/probabilisticsamplerprocessor/config_test.go +++ b/processor/probabilisticsamplerprocessor/config_test.go @@ -55,7 +55,7 @@ func TestLoadConfig(t *testing.T) { sub, err := processors.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/processor/redactionprocessor/config_test.go b/processor/redactionprocessor/config_test.go index 9b6a47173a70..7f7101d09eb6 100644 --- a/processor/redactionprocessor/config_test.go +++ b/processor/redactionprocessor/config_test.go @@ -48,7 +48,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/processor/resourcedetectionprocessor/config_test.go b/processor/resourcedetectionprocessor/config_test.go index 20ba6b7e7c6d..0140ebfc3914 100644 --- a/processor/resourcedetectionprocessor/config_test.go +++ b/processor/resourcedetectionprocessor/config_test.go @@ -145,7 +145,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)) if tt.expected == nil { assert.EqualError(t, component.ValidateConfig(cfg), tt.errorMessage) diff --git a/processor/resourcedetectionprocessor/factory_test.go b/processor/resourcedetectionprocessor/factory_test.go index 510f15c759a9..2d306dfb0232 100644 --- a/processor/resourcedetectionprocessor/factory_test.go +++ b/processor/resourcedetectionprocessor/factory_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" @@ -52,7 +51,7 @@ func TestCreateConfigProcessors(t *testing.T) { sub, err := cm.Sub(k) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) tt, err := factory.CreateTracesProcessor( context.Background(), diff --git a/processor/resourceprocessor/config_test.go b/processor/resourceprocessor/config_test.go index 765a898653cd..cd7a1314d97f 100644 --- a/processor/resourceprocessor/config_test.go +++ b/processor/resourceprocessor/config_test.go @@ -51,7 +51,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)) if tt.valid { assert.NoError(t, component.ValidateConfig(cfg)) diff --git a/processor/routingprocessor/config_test.go b/processor/routingprocessor/config_test.go index a34786670f2a..bda0bcd2be78 100644 --- a/processor/routingprocessor/config_test.go +++ b/processor/routingprocessor/config_test.go @@ -128,7 +128,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/processor/routingprocessor/factory_test.go b/processor/routingprocessor/factory_test.go index 1a8f2abe5a46..b07e682bff67 100644 --- a/processor/routingprocessor/factory_test.go +++ b/processor/routingprocessor/factory_test.go @@ -169,7 +169,7 @@ func TestProcessorDoesNotFailToBuildExportersWithMultiplePipelines(t *testing.T) sub, err := cm.Sub(k) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) exp, err := newMetricProcessor(noopTelemetrySettings, cfg) require.NoError(t, err) diff --git a/processor/schemaprocessor/config_test.go b/processor/schemaprocessor/config_test.go index 5afbafbae253..4cd33a31a1a4 100644 --- a/processor/schemaprocessor/config_test.go +++ b/processor/schemaprocessor/config_test.go @@ -28,7 +28,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "with-all-options").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.Equal(t, &Config{ ClientConfig: confighttp.NewDefaultClientConfig(), diff --git a/processor/spanprocessor/config_test.go b/processor/spanprocessor/config_test.go index 49490eb221ec..f0488fb1c0df 100644 --- a/processor/spanprocessor/config_test.go +++ b/processor/spanprocessor/config_test.go @@ -108,7 +108,7 @@ func TestLoadingConfig(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/processor/tailsamplingprocessor/config_test.go b/processor/tailsamplingprocessor/config_test.go index 8ee5b5124890..804ae3531267 100644 --- a/processor/tailsamplingprocessor/config_test.go +++ b/processor/tailsamplingprocessor/config_test.go @@ -28,7 +28,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)) assert.Equal(t, cfg, diff --git a/processor/tailsamplingprocessor/factory_test.go b/processor/tailsamplingprocessor/factory_test.go index 984e4483389d..06267f27091b 100644 --- a/processor/tailsamplingprocessor/factory_test.go +++ b/processor/tailsamplingprocessor/factory_test.go @@ -34,7 +34,7 @@ func TestCreateProcessor(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 := processortest.NewNopCreateSettings() tp, err := factory.CreateTracesProcessor(context.Background(), params, cfg, consumertest.NewNop()) diff --git a/processor/transformprocessor/config_test.go b/processor/transformprocessor/config_test.go index 1048ba19c36b..1e4c3f028580 100644 --- a/processor/transformprocessor/config_test.go +++ b/processor/transformprocessor/config_test.go @@ -158,7 +158,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) assert.NoError(t, err) - assert.NoError(t, component.UnmarshalConfig(sub, cfg)) + assert.NoError(t, sub.Unmarshal(cfg)) if tt.expected == nil { err = component.ValidateConfig(cfg) @@ -187,7 +187,7 @@ func Test_UnknownContextID(t *testing.T) { sub, err := cm.Sub(id.String()) assert.NoError(t, err) - assert.Error(t, component.UnmarshalConfig(sub, cfg)) + assert.Error(t, sub.Unmarshal(cfg)) } func Test_UnknownErrorMode(t *testing.T) { @@ -201,5 +201,5 @@ func Test_UnknownErrorMode(t *testing.T) { sub, err := cm.Sub(id.String()) assert.NoError(t, err) - assert.Error(t, component.UnmarshalConfig(sub, cfg)) + assert.Error(t, sub.Unmarshal(cfg)) } diff --git a/receiver/activedirectorydsreceiver/config_test.go b/receiver/activedirectorydsreceiver/config_test.go index 64d89d264c72..593c3002dc7a 100644 --- a/receiver/activedirectorydsreceiver/config_test.go +++ b/receiver/activedirectorydsreceiver/config_test.go @@ -54,7 +54,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)) if diff := cmp.Diff(tt.expected, cfg, cmpopts.IgnoreUnexported(metadata.MetricsBuilderConfig{}), cmpopts.IgnoreUnexported(metadata.MetricConfig{})); diff != "" { diff --git a/receiver/aerospikereceiver/config_test.go b/receiver/aerospikereceiver/config_test.go index 72a690854d92..6cfc64a83f3b 100644 --- a/receiver/aerospikereceiver/config_test.go +++ b/receiver/aerospikereceiver/config_test.go @@ -146,7 +146,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 = "localhost:3000" diff --git a/receiver/apachereceiver/config_test.go b/receiver/apachereceiver/config_test.go index 14be791a32f3..4df11f66fb3b 100644 --- a/receiver/apachereceiver/config_test.go +++ b/receiver/apachereceiver/config_test.go @@ -90,7 +90,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://localhost:8080/server-status?auto" diff --git a/receiver/awscloudwatchreceiver/config_test.go b/receiver/awscloudwatchreceiver/config_test.go index 2965e4a2421d..4da170bc895a 100644 --- a/receiver/awscloudwatchreceiver/config_test.go +++ b/receiver/awscloudwatchreceiver/config_test.go @@ -259,7 +259,7 @@ func TestLoadConfig(t *testing.T) { loaded, err := cm.Sub(component.NewIDWithName(metadata.Type, tc.name).String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(loaded, cfg)) + require.NoError(t, loaded.Unmarshal(cfg)) require.Equal(t, cfg, tc.expectedConfig) require.NoError(t, component.ValidateConfig(cfg)) }) diff --git a/receiver/awscontainerinsightreceiver/config_test.go b/receiver/awscontainerinsightreceiver/config_test.go index 64816a40a014..d65f21921b6a 100644 --- a/receiver/awscontainerinsightreceiver/config_test.go +++ b/receiver/awscontainerinsightreceiver/config_test.go @@ -48,7 +48,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/receiver/awsecscontainermetricsreceiver/config_test.go b/receiver/awsecscontainermetricsreceiver/config_test.go index 838bdc6a5ccc..ea6a09c8f662 100644 --- a/receiver/awsecscontainermetricsreceiver/config_test.go +++ b/receiver/awsecscontainermetricsreceiver/config_test.go @@ -45,7 +45,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/receiver/awsfirehosereceiver/config_test.go b/receiver/awsfirehosereceiver/config_test.go index 330e96dca4b8..d7ec5c71bb04 100644 --- a/receiver/awsfirehosereceiver/config_test.go +++ b/receiver/awsfirehosereceiver/config_test.go @@ -26,7 +26,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)) assert.NoError(t, component.ValidateConfig(cfg)) diff --git a/receiver/awss3receiver/config_test.go b/receiver/awss3receiver/config_test.go index fd5aee3d4306..789d188b5699 100644 --- a/receiver/awss3receiver/config_test.go +++ b/receiver/awss3receiver/config_test.go @@ -77,7 +77,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)) if tt.errorMessage != "" { assert.EqualError(t, component.ValidateConfig(cfg), tt.errorMessage) diff --git a/receiver/awsxrayreceiver/config_test.go b/receiver/awsxrayreceiver/config_test.go index caef308eef43..8f49ac4b8fc3 100644 --- a/receiver/awsxrayreceiver/config_test.go +++ b/receiver/awsxrayreceiver/config_test.go @@ -87,7 +87,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/receiver/azuremonitorreceiver/internal/metadata/metrics_test.go b/receiver/azuremonitorreceiver/internal/metadata/metrics_test.go index ec47ecc7fc63..bfc77948a518 100644 --- a/receiver/azuremonitorreceiver/internal/metadata/metrics_test.go +++ b/receiver/azuremonitorreceiver/internal/metadata/metrics_test.go @@ -8,7 +8,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/receiver/receivertest" @@ -109,6 +108,6 @@ func loadConfig(t *testing.T, name string) MetricsBuilderConfig { sub, err := cm.Sub(name) require.NoError(t, err) cfg := DefaultMetricsBuilderConfig() - require.NoError(t, component.UnmarshalConfig(sub, &cfg)) + require.NoError(t, sub.Unmarshal(&cfg)) return cfg } diff --git a/receiver/bigipreceiver/config_test.go b/receiver/bigipreceiver/config_test.go index 7b175fb67d2b..ceb5cc8e56ac 100644 --- a/receiver/bigipreceiver/config_test.go +++ b/receiver/bigipreceiver/config_test.go @@ -132,7 +132,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.Username = "otelu" diff --git a/receiver/carbonreceiver/config_test.go b/receiver/carbonreceiver/config_test.go index 0bad1d073655..f7a01681505d 100644 --- a/receiver/carbonreceiver/config_test.go +++ b/receiver/carbonreceiver/config_test.go @@ -85,7 +85,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/receiver/chronyreceiver/config_test.go b/receiver/chronyreceiver/config_test.go index 65e5d91b3438..3459cb5019f1 100644 --- a/receiver/chronyreceiver/config_test.go +++ b/receiver/chronyreceiver/config_test.go @@ -31,7 +31,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "custom").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) scs := scraperhelper.NewDefaultControllerConfig() scs.Timeout = 10 * time.Second diff --git a/receiver/cloudflarereceiver/config_test.go b/receiver/cloudflarereceiver/config_test.go index dae065f87e45..6053013a5ba4 100644 --- a/receiver/cloudflarereceiver/config_test.go +++ b/receiver/cloudflarereceiver/config_test.go @@ -138,7 +138,7 @@ func TestLoadConfig(t *testing.T) { loaded, err := cm.Sub(component.NewIDWithName(metadata.Type, tc.name).String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(loaded, cfg)) + require.NoError(t, loaded.Unmarshal(cfg)) require.Equal(t, tc.expectedConfig, cfg) require.NoError(t, component.ValidateConfig(cfg)) }) diff --git a/receiver/cloudfoundryreceiver/config_test.go b/receiver/cloudfoundryreceiver/config_test.go index 110d0d95a6b3..54b3741e6311 100644 --- a/receiver/cloudfoundryreceiver/config_test.go +++ b/receiver/cloudfoundryreceiver/config_test.go @@ -71,7 +71,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)) if tt.expected == nil { assert.EqualError(t, component.ValidateConfig(cfg), tt.errorMessage) diff --git a/receiver/collectdreceiver/config_test.go b/receiver/collectdreceiver/config_test.go index 5adedc525f1e..f92bafcaac21 100644 --- a/receiver/collectdreceiver/config_test.go +++ b/receiver/collectdreceiver/config_test.go @@ -54,7 +54,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)) if tt.wantErr == nil { assert.NoError(t, component.ValidateConfig(cfg)) diff --git a/receiver/couchdbreceiver/config_test.go b/receiver/couchdbreceiver/config_test.go index 0efeb01635aa..b2f0d8d3b44d 100644 --- a/receiver/couchdbreceiver/config_test.go +++ b/receiver/couchdbreceiver/config_test.go @@ -109,7 +109,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://localhost:5984" diff --git a/receiver/dockerstatsreceiver/config_test.go b/receiver/dockerstatsreceiver/config_test.go index d9a7db9f450d..490f0d2f2eb7 100644 --- a/receiver/dockerstatsreceiver/config_test.go +++ b/receiver/dockerstatsreceiver/config_test.go @@ -80,7 +80,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)) if diff := cmp.Diff(tt.expected, cfg, cmpopts.IgnoreUnexported(metadata.MetricConfig{}), cmpopts.IgnoreUnexported(metadata.ResourceAttributeConfig{})); diff != "" { diff --git a/receiver/elasticsearchreceiver/config_test.go b/receiver/elasticsearchreceiver/config_test.go index d28be30fcad5..1cc8c213c28a 100644 --- a/receiver/elasticsearchreceiver/config_test.go +++ b/receiver/elasticsearchreceiver/config_test.go @@ -182,7 +182,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)) if diff := cmp.Diff(tt.expected, cfg, cmpopts.IgnoreUnexported(metadata.MetricConfig{}), cmpopts.IgnoreUnexported(metadata.ResourceAttributeConfig{})); diff != "" { diff --git a/receiver/expvarreceiver/config_test.go b/receiver/expvarreceiver/config_test.go index 8f47e81be257..426af778d331 100644 --- a/receiver/expvarreceiver/config_test.go +++ b/receiver/expvarreceiver/config_test.go @@ -76,7 +76,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)) if tt.expected == nil { assert.EqualError(t, component.ValidateConfig(cfg), tt.errorMessage) diff --git a/receiver/filelogreceiver/filelog_test.go b/receiver/filelogreceiver/filelog_test.go index e024cad9f01f..96355eade0d1 100644 --- a/receiver/filelogreceiver/filelog_test.go +++ b/receiver/filelogreceiver/filelog_test.go @@ -50,7 +50,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(component.MustNewID("filelog").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, testdataConfigYaml(), cfg) diff --git a/receiver/flinkmetricsreceiver/config_test.go b/receiver/flinkmetricsreceiver/config_test.go index c7b271630edb..e228c2e9461e 100644 --- a/receiver/flinkmetricsreceiver/config_test.go +++ b/receiver/flinkmetricsreceiver/config_test.go @@ -69,7 +69,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://localhost:8081" diff --git a/receiver/fluentforwardreceiver/config_test.go b/receiver/fluentforwardreceiver/config_test.go index 50c58cbde1a5..613b80445ac3 100644 --- a/receiver/fluentforwardreceiver/config_test.go +++ b/receiver/fluentforwardreceiver/config_test.go @@ -22,7 +22,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(component.MustNewID("fluentforward").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, factory.CreateDefaultConfig(), cfg) diff --git a/receiver/googlecloudpubsubreceiver/config_test.go b/receiver/googlecloudpubsubreceiver/config_test.go index 71f25e9be6ea..a2fecdb13756 100644 --- a/receiver/googlecloudpubsubreceiver/config_test.go +++ b/receiver/googlecloudpubsubreceiver/config_test.go @@ -52,7 +52,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/receiver/googlecloudspannerreceiver/config_test.go b/receiver/googlecloudspannerreceiver/config_test.go index 0dd720f8f8cd..fb7670b941a4 100644 --- a/receiver/googlecloudspannerreceiver/config_test.go +++ b/receiver/googlecloudspannerreceiver/config_test.go @@ -29,7 +29,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)) assert.Equal(t, &Config{ diff --git a/receiver/jaegerreceiver/config_test.go b/receiver/jaegerreceiver/config_test.go index dd589a4420aa..8fddeaf4b7a4 100644 --- a/receiver/jaegerreceiver/config_test.go +++ b/receiver/jaegerreceiver/config_test.go @@ -135,7 +135,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) @@ -151,17 +151,17 @@ func TestFailedLoadConfig(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "typo_default_proto_config").String()) require.NoError(t, err) - err = component.UnmarshalConfig(sub, cfg) + err = sub.Unmarshal(cfg) assert.EqualError(t, err, "1 error(s) decoding:\n\n* 'protocols' has invalid keys: thrift_htttp") sub, err = cm.Sub(component.NewIDWithName(metadata.Type, "bad_proto_config").String()) require.NoError(t, err) - err = component.UnmarshalConfig(sub, cfg) + err = sub.Unmarshal(cfg) assert.EqualError(t, err, "1 error(s) decoding:\n\n* 'protocols' has invalid keys: thrift_htttp") sub, err = cm.Sub(component.NewIDWithName(metadata.Type, "empty").String()) require.NoError(t, err) - err = component.UnmarshalConfig(sub, cfg) + err = sub.Unmarshal(cfg) assert.EqualError(t, err, "empty config for Jaeger receiver") } diff --git a/receiver/jaegerreceiver/factory_test.go b/receiver/jaegerreceiver/factory_test.go index 2e931b663ce9..dea62f513147 100644 --- a/receiver/jaegerreceiver/factory_test.go +++ b/receiver/jaegerreceiver/factory_test.go @@ -63,7 +63,7 @@ func TestCreateReceiverGeneralConfig(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)) set := receivertest.NewNopCreateSettings() tReceiver, err := factory.CreateTracesReceiver(context.Background(), set, cfg, nil) diff --git a/receiver/jmxreceiver/config_test.go b/receiver/jmxreceiver/config_test.go index 4f870a07861c..2e3db606e903 100644 --- a/receiver/jmxreceiver/config_test.go +++ b/receiver/jmxreceiver/config_test.go @@ -211,7 +211,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)) if tt.expectedErr != "" { assert.ErrorContains(t, cfg.(*Config).Validate(), tt.expectedErr) @@ -237,7 +237,7 @@ func TestCustomMetricsGathererConfig(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "invalidtargetsystem").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) conf := cfg.(*Config) diff --git a/receiver/journaldreceiver/journald_test.go b/receiver/journaldreceiver/journald_test.go index 29ab8921fae8..391216995a7c 100644 --- a/receiver/journaldreceiver/journald_test.go +++ b/receiver/journaldreceiver/journald_test.go @@ -32,7 +32,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)) assert.Equal(t, testdataConfigYaml(), cfg) } diff --git a/receiver/k8sclusterreceiver/config_test.go b/receiver/k8sclusterreceiver/config_test.go index 345e061858c8..7cfbb46c6f0e 100644 --- a/receiver/k8sclusterreceiver/config_test.go +++ b/receiver/k8sclusterreceiver/config_test.go @@ -69,7 +69,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/receiver/k8seventsreceiver/config_test.go b/receiver/k8seventsreceiver/config_test.go index a04b28e27a44..ddb612bfee20 100644 --- a/receiver/k8seventsreceiver/config_test.go +++ b/receiver/k8seventsreceiver/config_test.go @@ -49,7 +49,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/receiver/k8sobjectsreceiver/config_test.go b/receiver/k8sobjectsreceiver/config_test.go index b6e8ac7be1da..de75fa4f7617 100644 --- a/receiver/k8sobjectsreceiver/config_test.go +++ b/receiver/k8sobjectsreceiver/config_test.go @@ -150,7 +150,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)) if tt.expected == nil { err = component.ValidateConfig(cfg) diff --git a/receiver/kafkametricsreceiver/config_test.go b/receiver/kafkametricsreceiver/config_test.go index 930405d361e8..a02484acb519 100644 --- a/receiver/kafkametricsreceiver/config_test.go +++ b/receiver/kafkametricsreceiver/config_test.go @@ -26,7 +26,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)) assert.Equal(t, &Config{ ControllerConfig: scraperhelper.NewDefaultControllerConfig(), diff --git a/receiver/kafkareceiver/config_test.go b/receiver/kafkareceiver/config_test.go index 9d397bf93602..09a0793e8ade 100644 --- a/receiver/kafkareceiver/config_test.go +++ b/receiver/kafkareceiver/config_test.go @@ -103,7 +103,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/receiver/kubeletstatsreceiver/config_test.go b/receiver/kubeletstatsreceiver/config_test.go index 117bb07b5165..5e2fafd845fb 100644 --- a/receiver/kubeletstatsreceiver/config_test.go +++ b/receiver/kubeletstatsreceiver/config_test.go @@ -210,7 +210,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)) err = component.ValidateConfig(cfg) if tt.expectedValidationErr != "" { diff --git a/receiver/lokireceiver/config_test.go b/receiver/lokireceiver/config_test.go index 181b6e41d749..699d1182fafd 100644 --- a/receiver/lokireceiver/config_test.go +++ b/receiver/lokireceiver/config_test.go @@ -70,7 +70,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) @@ -99,7 +99,7 @@ func TestInvalidConfig(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)) err = component.ValidateConfig(cfg) assert.Error(t, err, tt.err) @@ -128,7 +128,7 @@ func TestConfigWithUnknownKeysConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - assert.Contains(t, component.UnmarshalConfig(sub, cfg).Error(), tt.err) + assert.Contains(t, sub.Unmarshal(cfg).Error(), tt.err) }) } } diff --git a/receiver/memcachedreceiver/config_test.go b/receiver/memcachedreceiver/config_test.go index d3a21e7dd2ab..1220f0d2eb44 100644 --- a/receiver/memcachedreceiver/config_test.go +++ b/receiver/memcachedreceiver/config_test.go @@ -29,7 +29,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)) require.Equal(t, factory.CreateDefaultConfig(), cfg) } diff --git a/receiver/mongodbatlasreceiver/config_test.go b/receiver/mongodbatlasreceiver/config_test.go index cd5305a0bad8..e9ff7777cf5b 100644 --- a/receiver/mongodbatlasreceiver/config_test.go +++ b/receiver/mongodbatlasreceiver/config_test.go @@ -358,7 +358,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.MetricsBuilderConfig = metadata.DefaultMetricsBuilderConfig() diff --git a/receiver/mongodbreceiver/config_test.go b/receiver/mongodbreceiver/config_test.go index 0a0ee5358200..1cb166016a70 100644 --- a/receiver/mongodbreceiver/config_test.go +++ b/receiver/mongodbreceiver/config_test.go @@ -206,7 +206,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.Hosts = []confignet.AddrConfig{ diff --git a/receiver/mysqlreceiver/config_test.go b/receiver/mysqlreceiver/config_test.go index 2b63e2b1cf5c..4b26b147cb5b 100644 --- a/receiver/mysqlreceiver/config_test.go +++ b/receiver/mysqlreceiver/config_test.go @@ -24,7 +24,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 = "localhost:3306" @@ -47,7 +47,7 @@ func TestLoadConfigDefaultTLS(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String() + "/default_tls") require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) expected := factory.CreateDefaultConfig().(*Config) expected.Endpoint = "localhost:3306" diff --git a/receiver/namedpipereceiver/namedpipe_test.go b/receiver/namedpipereceiver/namedpipe_test.go index e0f8703d94df..1116f33dca73 100644 --- a/receiver/namedpipereceiver/namedpipe_test.go +++ b/receiver/namedpipereceiver/namedpipe_test.go @@ -42,7 +42,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(component.MustNewID("namedpipe").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, testdataConfigYaml(), cfg) diff --git a/receiver/nginxreceiver/config_test.go b/receiver/nginxreceiver/config_test.go index c3f941c65767..03f2c926a895 100644 --- a/receiver/nginxreceiver/config_test.go +++ b/receiver/nginxreceiver/config_test.go @@ -23,7 +23,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)) assert.Equal(t, factory.CreateDefaultConfig(), cfg) } diff --git a/receiver/nsxtreceiver/config_test.go b/receiver/nsxtreceiver/config_test.go index 15161f626ed1..a29b64eafc91 100644 --- a/receiver/nsxtreceiver/config_test.go +++ b/receiver/nsxtreceiver/config_test.go @@ -94,7 +94,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 = "https://nsx-manager-endpoint" diff --git a/receiver/opencensusreceiver/config_test.go b/receiver/opencensusreceiver/config_test.go index 54260ba6668c..8929c80e42fe 100644 --- a/receiver/opencensusreceiver/config_test.go +++ b/receiver/opencensusreceiver/config_test.go @@ -138,7 +138,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/receiver/oracledbreceiver/config_test.go b/receiver/oracledbreceiver/config_test.go index ba03402451a3..1e0593a05755 100644 --- a/receiver/oracledbreceiver/config_test.go +++ b/receiver/oracledbreceiver/config_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/receiver/scraperhelper" ) @@ -129,7 +128,7 @@ func TestParseConfig(t *testing.T) { cfg := createDefaultConfig().(*Config) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.Equal(t, "oracle://otel:password@localhost:51521/XE", cfg.DataSource) assert.Equal(t, "otel", cfg.Username) assert.Equal(t, "password", cfg.Password) diff --git a/receiver/otelarrowreceiver/config_test.go b/receiver/otelarrowreceiver/config_test.go index 9cb16dab0ecf..f756e1b6b1a5 100644 --- a/receiver/otelarrowreceiver/config_test.go +++ b/receiver/otelarrowreceiver/config_test.go @@ -22,7 +22,7 @@ func TestUnmarshalDefaultConfig(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.NoError(t, cm.Unmarshal(cfg)) defaultCfg := factory.CreateDefaultConfig().(*Config) assert.Equal(t, defaultCfg, cfg) } @@ -32,7 +32,7 @@ func TestUnmarshalConfigOnlyGRPC(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.NoError(t, cm.Unmarshal(cfg)) defaultOnlyGRPC := factory.CreateDefaultConfig().(*Config) assert.Equal(t, defaultOnlyGRPC, cfg) @@ -43,7 +43,7 @@ func TestUnmarshalConfig(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.NoError(t, cm.Unmarshal(cfg)) assert.Equal(t, &Config{ Protocols: Protocols{ @@ -89,7 +89,7 @@ func TestUnmarshalConfigUnix(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.NoError(t, component.UnmarshalConfig(cm, cfg)) + assert.NoError(t, cm.Unmarshal(cfg)) assert.Equal(t, &Config{ Protocols: Protocols{ @@ -112,7 +112,7 @@ func TestUnmarshalConfigTypoDefaultProtocol(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.EqualError(t, component.UnmarshalConfig(cm, cfg), "1 error(s) decoding:\n\n* 'protocols' has invalid keys: htttp") + assert.EqualError(t, cm.Unmarshal(cfg), "1 error(s) decoding:\n\n* 'protocols' has invalid keys: htttp") } func TestUnmarshalConfigInvalidProtocol(t *testing.T) { @@ -120,7 +120,7 @@ func TestUnmarshalConfigInvalidProtocol(t *testing.T) { require.NoError(t, err) factory := NewFactory() cfg := factory.CreateDefaultConfig() - assert.EqualError(t, component.UnmarshalConfig(cm, cfg), "1 error(s) decoding:\n\n* 'protocols' has invalid keys: thrift") + assert.EqualError(t, cm.Unmarshal(cfg), "1 error(s) decoding:\n\n* 'protocols' has invalid keys: thrift") } func TestUnmarshalConfigNoProtocols(t *testing.T) { diff --git a/receiver/otlpjsonfilereceiver/file_test.go b/receiver/otlpjsonfilereceiver/file_test.go index 45693fddfdef..da2a911bfacd 100644 --- a/receiver/otlpjsonfilereceiver/file_test.go +++ b/receiver/otlpjsonfilereceiver/file_test.go @@ -186,7 +186,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)) assert.Equal(t, testdataConfigYamlAsMap(), cfg) } diff --git a/receiver/podmanreceiver/config_test.go b/receiver/podmanreceiver/config_test.go index a10307e36329..af10cde71b25 100644 --- a/receiver/podmanreceiver/config_test.go +++ b/receiver/podmanreceiver/config_test.go @@ -63,7 +63,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/receiver/postgresqlreceiver/config_test.go b/receiver/postgresqlreceiver/config_test.go index 3995f2776679..591d1cedae08 100644 --- a/receiver/postgresqlreceiver/config_test.go +++ b/receiver/postgresqlreceiver/config_test.go @@ -119,7 +119,7 @@ func TestLoadConfig(t *testing.T) { t.Run("postgresql/minimal", func(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "minimal").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) expected := factory.CreateDefaultConfig().(*Config) expected.Endpoint = "localhost:5432" @@ -132,7 +132,7 @@ func TestLoadConfig(t *testing.T) { t.Run("postgresql/pool", func(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "pool").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) expected := factory.CreateDefaultConfig().(*Config) expected.Endpoint = "localhost:5432" @@ -150,7 +150,7 @@ func TestLoadConfig(t *testing.T) { t.Run("postgresql/all", func(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "all").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) expected := factory.CreateDefaultConfig().(*Config) expected.Endpoint = "localhost:5432" diff --git a/receiver/prometheusreceiver/config_test.go b/receiver/prometheusreceiver/config_test.go index d7477cb74387..64846315eee1 100644 --- a/receiver/prometheusreceiver/config_test.go +++ b/receiver/prometheusreceiver/config_test.go @@ -31,14 +31,14 @@ 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)) r0 := cfg.(*Config) assert.Equal(t, r0, factory.CreateDefaultConfig()) 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)) r1 := cfg.(*Config) assert.Equal(t, r1.PrometheusConfig.ScrapeConfigs[0].JobName, "demo") @@ -66,7 +66,7 @@ func TestLoadTargetAllocatorConfig(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)) require.NoError(t, component.ValidateConfig(cfg)) r0 := cfg.(*Config) @@ -81,7 +81,7 @@ func TestLoadTargetAllocatorConfig(t *testing.T) { sub, err = cm.Sub(component.NewIDWithName(metadata.Type, "withScrape").String()) require.NoError(t, err) cfg = factory.CreateDefaultConfig() - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) require.NoError(t, component.ValidateConfig(cfg)) r1 := cfg.(*Config) @@ -97,7 +97,7 @@ func TestLoadTargetAllocatorConfig(t *testing.T) { sub, err = cm.Sub(component.NewIDWithName(metadata.Type, "withOnlyScrape").String()) require.NoError(t, err) cfg = factory.CreateDefaultConfig() - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) require.NoError(t, component.ValidateConfig(cfg)) r2 := cfg.(*Config) @@ -114,7 +114,7 @@ func TestLoadConfigFailsOnUnknownSection(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) require.NoError(t, err) - require.Error(t, component.UnmarshalConfig(sub, cfg)) + require.Error(t, sub.Unmarshal(cfg)) } func TestLoadConfigFailsOnNoPrometheusOrTAConfig(t *testing.T) { @@ -125,25 +125,25 @@ func TestLoadConfigFailsOnNoPrometheusOrTAConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() 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)) require.ErrorContains(t, component.ValidateConfig(cfg), "no Prometheus scrape_configs or target_allocator set") cfg = factory.CreateDefaultConfig() sub, err = cm.Sub(component.NewIDWithName(metadata.Type, "withConfigAndTA").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) require.NoError(t, component.ValidateConfig(cfg)) cfg = factory.CreateDefaultConfig() sub, err = cm.Sub(component.NewIDWithName(metadata.Type, "withOnlyTA").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) require.NoError(t, component.ValidateConfig(cfg)) cfg = factory.CreateDefaultConfig() sub, err = cm.Sub(component.NewIDWithName(metadata.Type, "withOnlyScrape").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) require.NoError(t, component.ValidateConfig(cfg)) } @@ -158,7 +158,7 @@ func TestLoadConfigFailsOnUnknownPrometheusSection(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) require.NoError(t, err) - require.Error(t, component.UnmarshalConfig(sub, cfg)) + require.Error(t, sub.Unmarshal(cfg)) } // Renaming emits a warning @@ -171,7 +171,7 @@ func TestConfigWarningsOnRenameDisallowed(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)) // Use a fake logger creationSet := receivertest.NewNopCreateSettings() observedZapCore, observedLogs := observer.New(zap.WarnLevel) @@ -190,7 +190,7 @@ func TestRejectUnsupportedPrometheusFeatures(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)) err = component.ValidateConfig(cfg) require.Error(t, err) @@ -214,7 +214,7 @@ func TestNonExistentAuthCredentialsFile(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)) assert.ErrorContains(t, component.ValidateConfig(cfg), @@ -229,7 +229,7 @@ func TestTLSConfigNonExistentCertFile(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)) assert.ErrorContains(t, component.ValidateConfig(cfg), @@ -244,7 +244,7 @@ func TestTLSConfigNonExistentKeyFile(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)) assert.ErrorContains(t, component.ValidateConfig(cfg), @@ -261,7 +261,7 @@ func TestTLSConfigCertFileWithoutKeyFile(t *testing.T) { require.NoError(t, err) assert.ErrorContains(t, - component.UnmarshalConfig(sub, cfg), + sub.Unmarshal(cfg), "exactly one of key or key_file must be configured when a client certificate is configured") } @@ -274,7 +274,7 @@ func TestTLSConfigKeyFileWithoutCertFile(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) require.NoError(t, err) assert.ErrorContains(t, - component.UnmarshalConfig(sub, cfg), + sub.Unmarshal(cfg), "exactly one of cert or cert_file must be configured when a client key is configured") } @@ -288,7 +288,7 @@ func TestKubernetesSDConfigWithoutKeyFile(t *testing.T) { require.NoError(t, err) assert.ErrorContains(t, - component.UnmarshalConfig(sub, cfg), + sub.Unmarshal(cfg), "exactly one of key or key_file must be configured when a client certificate is configured") } @@ -300,7 +300,7 @@ func TestFileSDConfigJsonNilTargetGroup(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)) require.NoError(t, component.ValidateConfig(cfg)) } @@ -313,7 +313,7 @@ func TestFileSDConfigYamlNilTargetGroup(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)) require.NoError(t, component.ValidateConfig(cfg)) } @@ -326,7 +326,7 @@ func TestTargetAllocatorInvalidHTTPScrape(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) require.NoError(t, err) - require.Error(t, component.UnmarshalConfig(sub, cfg)) + require.Error(t, sub.Unmarshal(cfg)) } func TestFileSDConfigWithoutSDFile(t *testing.T) { @@ -337,7 +337,7 @@ func TestFileSDConfigWithoutSDFile(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)) require.NoError(t, component.ValidateConfig(cfg)) } diff --git a/receiver/prometheusreceiver/factory_test.go b/receiver/prometheusreceiver/factory_test.go index e60ac142b152..ca8e0ece4521 100644 --- a/receiver/prometheusreceiver/factory_test.go +++ b/receiver/prometheusreceiver/factory_test.go @@ -44,7 +44,7 @@ func TestFactoryCanParseServiceDiscoveryConfigs(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "").String()) require.NoError(t, err) - assert.NoError(t, component.UnmarshalConfig(sub, cfg)) + assert.NoError(t, sub.Unmarshal(cfg)) } func TestMultipleCreate(t *testing.T) { diff --git a/receiver/pulsarreceiver/config_test.go b/receiver/pulsarreceiver/config_test.go index dfa0ea121b2c..b6521e02f251 100644 --- a/receiver/pulsarreceiver/config_test.go +++ b/receiver/pulsarreceiver/config_test.go @@ -23,7 +23,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)) assert.Equal(t, &Config{ Topic: "otel-pulsar", diff --git a/receiver/purefareceiver/config_test.go b/receiver/purefareceiver/config_test.go index e641a086f7b7..5dfb36922521 100644 --- a/receiver/purefareceiver/config_test.go +++ b/receiver/purefareceiver/config_test.go @@ -50,7 +50,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/receiver/purefbreceiver/config_test.go b/receiver/purefbreceiver/config_test.go index 5d620264bdbc..c0d85b72da56 100644 --- a/receiver/purefbreceiver/config_test.go +++ b/receiver/purefbreceiver/config_test.go @@ -47,7 +47,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/receiver/rabbitmqreceiver/config_test.go b/receiver/rabbitmqreceiver/config_test.go index c1e333cbfaf1..258386e6486d 100644 --- a/receiver/rabbitmqreceiver/config_test.go +++ b/receiver/rabbitmqreceiver/config_test.go @@ -110,7 +110,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://localhost:15672" diff --git a/receiver/receivercreator/config_test.go b/receiver/receivercreator/config_test.go index 533118e9f5b1..32cae0d9bf37 100644 --- a/receiver/receivercreator/config_test.go +++ b/receiver/receivercreator/config_test.go @@ -127,7 +127,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/receiver/receivercreator/receiver_test.go b/receiver/receivercreator/receiver_test.go index 68d0bf801846..d00b5e7a9f2b 100644 --- a/receiver/receivercreator/receiver_test.go +++ b/receiver/receivercreator/receiver_test.go @@ -73,7 +73,7 @@ func TestMockedEndToEnd(t *testing.T) { cfg := factory.CreateDefaultConfig() 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)) params := receivertest.NewNopCreateSettings() mockConsumer := new(consumertest.MetricsSink) diff --git a/receiver/receivercreator/runner.go b/receiver/receivercreator/runner.go index de1fd7857c52..098f2231afdd 100644 --- a/receiver/receivercreator/runner.go +++ b/receiver/receivercreator/runner.go @@ -133,7 +133,7 @@ func (run *receiverRunner) loadRuntimeReceiverConfig( } receiverCfg := factory.CreateDefaultConfig() - if err := component.UnmarshalConfig(mergedConfig, receiverCfg); err != nil { + if err := mergedConfig.Unmarshal(receiverCfg); err != nil { return nil, "", fmt.Errorf("failed to load %q template config: %w", receiver.id.String(), err) } return receiverCfg, targetEndpoint, nil diff --git a/receiver/redisreceiver/config_test.go b/receiver/redisreceiver/config_test.go index 0863408bc19d..86b451ca59b6 100644 --- a/receiver/redisreceiver/config_test.go +++ b/receiver/redisreceiver/config_test.go @@ -27,7 +27,7 @@ func TestConfig(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)) assert.Equal(t, &Config{ diff --git a/receiver/saphanareceiver/config_test.go b/receiver/saphanareceiver/config_test.go index 898983925f05..0a53bcf7b428 100644 --- a/receiver/saphanareceiver/config_test.go +++ b/receiver/saphanareceiver/config_test.go @@ -80,7 +80,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.MetricsBuilderConfig = metadata.DefaultMetricsBuilderConfig() diff --git a/receiver/sapmreceiver/config_test.go b/receiver/sapmreceiver/config_test.go index 2ba96ae502cc..5062c81fde6a 100644 --- a/receiver/sapmreceiver/config_test.go +++ b/receiver/sapmreceiver/config_test.go @@ -74,7 +74,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/receiver/signalfxreceiver/config_test.go b/receiver/signalfxreceiver/config_test.go index 9951e90c4084..fe16f538cf3a 100644 --- a/receiver/signalfxreceiver/config_test.go +++ b/receiver/signalfxreceiver/config_test.go @@ -69,7 +69,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/receiver/simpleprometheusreceiver/config_test.go b/receiver/simpleprometheusreceiver/config_test.go index c9e36803238e..2fa4521019ca 100644 --- a/receiver/simpleprometheusreceiver/config_test.go +++ b/receiver/simpleprometheusreceiver/config_test.go @@ -85,7 +85,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/receiver/skywalkingreceiver/config_test.go b/receiver/skywalkingreceiver/config_test.go index 935b5b193a3f..b9738b1c2230 100644 --- a/receiver/skywalkingreceiver/config_test.go +++ b/receiver/skywalkingreceiver/config_test.go @@ -64,7 +64,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/receiver/skywalkingreceiver/factory_test.go b/receiver/skywalkingreceiver/factory_test.go index 29535c158616..dc01ac455e22 100644 --- a/receiver/skywalkingreceiver/factory_test.go +++ b/receiver/skywalkingreceiver/factory_test.go @@ -68,7 +68,7 @@ func TestCreateReceiverGeneralConfig(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)) set := receivertest.NewNopCreateSettings() traceSink := new(consumertest.TracesSink) diff --git a/receiver/snmpreceiver/config_test.go b/receiver/snmpreceiver/config_test.go index 47fc7d675616..6746b7821893 100644 --- a/receiver/snmpreceiver/config_test.go +++ b/receiver/snmpreceiver/config_test.go @@ -253,7 +253,7 @@ func TestLoadConfigConnectionConfigs(t *testing.T) { require.NoError(t, err) cfg := factory.CreateDefaultConfig() - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if test.expectedErr == "" { require.NoError(t, component.ValidateConfig(cfg)) } else { @@ -997,7 +997,7 @@ func TestLoadConfigMetricConfigs(t *testing.T) { require.NoError(t, err) cfg := factory.CreateDefaultConfig() - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if test.expectedErr == "" { require.NoError(t, component.ValidateConfig(cfg)) } else { diff --git a/receiver/snowflakereceiver/config_test.go b/receiver/snowflakereceiver/config_test.go index 4235f9615f5e..6c4421afa0bc 100644 --- a/receiver/snowflakereceiver/config_test.go +++ b/receiver/snowflakereceiver/config_test.go @@ -135,7 +135,7 @@ func TestLoadConfig(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() - require.NoError(t, component.UnmarshalConfig(cmNoStr, cfg)) + require.NoError(t, cmNoStr.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) diff := cmp.Diff(expected, cfg, cmpopts.IgnoreUnexported(metadata.MetricConfig{}), cmpopts.IgnoreUnexported(metadata.ResourceAttributeConfig{})) diff --git a/receiver/solacereceiver/config_test.go b/receiver/solacereceiver/config_test.go index c3746a417c5a..e0169e79c27d 100644 --- a/receiver/solacereceiver/config_test.go +++ b/receiver/solacereceiver/config_test.go @@ -68,7 +68,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)) if tt.expectedErr != nil { assert.ErrorIs(t, component.ValidateConfig(cfg), tt.expectedErr) diff --git a/receiver/solacereceiver/factory_test.go b/receiver/solacereceiver/factory_test.go index d14dd9df59d1..b7ccfabfabe4 100644 --- a/receiver/solacereceiver/factory_test.go +++ b/receiver/solacereceiver/factory_test.go @@ -28,7 +28,7 @@ func TestCreateTracesReceiver(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "primary").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) set := receivertest.NewNopCreateSettings() set.ID = component.MustNewIDWithName("solace", "factory") @@ -86,7 +86,7 @@ func TestCreateTracesReceiverBadMetrics(t *testing.T) { sub, err := cm.Sub(component.NewIDWithName(metadata.Type, "primary").String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) set := receivertest.NewNopCreateSettings() set.ID = component.MustNewIDWithName("solace", "factory") receiver, err := factory.CreateTracesReceiver( diff --git a/receiver/splunkhecreceiver/config_test.go b/receiver/splunkhecreceiver/config_test.go index 2da02b3bb90c..4e93675835df 100644 --- a/receiver/splunkhecreceiver/config_test.go +++ b/receiver/splunkhecreceiver/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/receiver/sqlqueryreceiver/config_test.go b/receiver/sqlqueryreceiver/config_test.go index 5d7c3b6db867..14931601ad9b 100644 --- a/receiver/sqlqueryreceiver/config_test.go +++ b/receiver/sqlqueryreceiver/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)) if tt.expected == nil { assert.ErrorContains(t, component.ValidateConfig(cfg), tt.errorMessage) @@ -182,7 +182,7 @@ func TestConfig_Validate_Multierr(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)) err = component.ValidateConfig(cfg) diff --git a/receiver/sqlserverreceiver/config_test.go b/receiver/sqlserverreceiver/config_test.go index 439f5041af76..d4d25cfac11e 100644 --- a/receiver/sqlserverreceiver/config_test.go +++ b/receiver/sqlserverreceiver/config_test.go @@ -85,7 +85,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub("sqlserver") 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, factory.CreateDefaultConfig(), cfg) @@ -118,7 +118,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub("sqlserver/named") require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) assert.NoError(t, component.ValidateConfig(cfg)) if diff := cmp.Diff(expected, cfg, cmpopts.IgnoreUnexported(metadata.MetricConfig{}), cmpopts.IgnoreUnexported(metadata.ResourceAttributeConfig{})); diff != "" { diff --git a/receiver/statsdreceiver/config_test.go b/receiver/statsdreceiver/config_test.go index ef98e777f99a..ce690ae99b8c 100644 --- a/receiver/statsdreceiver/config_test.go +++ b/receiver/statsdreceiver/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/receiver/syslogreceiver/syslog_test.go b/receiver/syslogreceiver/syslog_test.go index fcd062e50678..e87bb112f7aa 100644 --- a/receiver/syslogreceiver/syslog_test.go +++ b/receiver/syslogreceiver/syslog_test.go @@ -86,7 +86,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub("syslog") 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, testdataConfigYaml(), cfg) diff --git a/receiver/tcplogreceiver/tcp_test.go b/receiver/tcplogreceiver/tcp_test.go index cb784db7b2fc..64d6058b4e55 100644 --- a/receiver/tcplogreceiver/tcp_test.go +++ b/receiver/tcplogreceiver/tcp_test.go @@ -71,7 +71,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub("tcplog") 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, testdataConfigYaml(), cfg) diff --git a/receiver/udplogreceiver/udp_test.go b/receiver/udplogreceiver/udp_test.go index e632100a127f..d91ed139d424 100644 --- a/receiver/udplogreceiver/udp_test.go +++ b/receiver/udplogreceiver/udp_test.go @@ -89,7 +89,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub("udplog") 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, testdataConfigYaml("127.0.0.1:29018"), cfg) diff --git a/receiver/wavefrontreceiver/config_test.go b/receiver/wavefrontreceiver/config_test.go index 45ea42bd30ee..5c1828ea0b1f 100644 --- a/receiver/wavefrontreceiver/config_test.go +++ b/receiver/wavefrontreceiver/config_test.go @@ -50,7 +50,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/receiver/webhookeventreceiver/config_test.go b/receiver/webhookeventreceiver/config_test.go index 3e76dff3c5b7..52cc4930e9cc 100644 --- a/receiver/webhookeventreceiver/config_test.go +++ b/receiver/webhookeventreceiver/config_test.go @@ -139,7 +139,7 @@ func TestLoadConfig(t *testing.T) { // create expected config factory := NewFactory() conf := factory.CreateDefaultConfig() - require.NoError(t, component.UnmarshalConfig(cmNoStr, conf)) + require.NoError(t, cmNoStr.Unmarshal(conf)) require.NoError(t, component.ValidateConfig(conf)) require.Equal(t, expect, conf) diff --git a/receiver/windowseventlogreceiver/receiver_windows_test.go b/receiver/windowseventlogreceiver/receiver_windows_test.go index e22e294580db..245cdf9169c8 100644 --- a/receiver/windowseventlogreceiver/receiver_windows_test.go +++ b/receiver/windowseventlogreceiver/receiver_windows_test.go @@ -43,7 +43,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)) assert.Equal(t, createTestConfig(), cfg) } diff --git a/receiver/windowsperfcountersreceiver/config_test.go b/receiver/windowsperfcountersreceiver/config_test.go index 6f5242b7ea2a..db22ea8dc0a8 100644 --- a/receiver/windowsperfcountersreceiver/config_test.go +++ b/receiver/windowsperfcountersreceiver/config_test.go @@ -218,7 +218,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)) if tt.expectedErr != "" { assert.Equal(t, tt.expectedErr, component.ValidateConfig(cfg).Error()) diff --git a/receiver/zipkinreceiver/config_test.go b/receiver/zipkinreceiver/config_test.go index 5bd2e350c8ea..fb0117ba6d15 100644 --- a/receiver/zipkinreceiver/config_test.go +++ b/receiver/zipkinreceiver/config_test.go @@ -57,7 +57,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)