diff --git a/internal/collector/otel_collector_plugin_test.go b/internal/collector/otel_collector_plugin_test.go index 941b4c24c..002df2c8e 100644 --- a/internal/collector/otel_collector_plugin_test.go +++ b/internal/collector/otel_collector_plugin_test.go @@ -511,6 +511,8 @@ func TestCollector_updateExistingNginxOSSReceiver(t *testing.T) { collector, err := New(conf) require.NoError(tt, err, "NewCollector should not return an error with valid config") + collector.service = createFakeCollector() + nginxReceiverFound, reloadCollector := collector.updateExistingNginxOSSReceiver(test.nginxConfigContext) assert.True(tt, nginxReceiverFound) @@ -580,6 +582,8 @@ func TestCollector_updateExistingNginxPlusReceiver(t *testing.T) { collector, err := New(conf) require.NoError(tt, err, "NewCollector should not return an error with valid config") + collector.service = createFakeCollector() + nginxReceiverFound, reloadCollector := collector.updateExistingNginxPlusReceiver(test.nginxConfigContext) assert.True(tt, nginxReceiverFound) @@ -633,6 +637,8 @@ func TestCollector_updateResourceAttributes(t *testing.T) { collector, err := New(conf) require.NoError(tt, err, "NewCollector should not return an error with valid config") + collector.service = createFakeCollector() + // set up Actions conf.Collector.Processors.Resource = &config.Resource{Attributes: test.setup}