From 4ef513dd966840dd941c8e6903ad593a0a140087 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 5 Dec 2022 08:23:38 -0800 Subject: [PATCH] [chore] remove usage of component.Factories in service/extiension (#6674) Signed-off-by: Bogdan Drutu --- service/extensions/extensions_test.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/service/extensions/extensions_test.go b/service/extensions/extensions_test.go index 691d4d9be66..aad9cef506c 100644 --- a/service/extensions/extensions_test.go +++ b/service/extensions/extensions_test.go @@ -39,7 +39,7 @@ func TestBuildExtensions(t *testing.T) { tests := []struct { name string - factories component.Factories + factories map[component.Type]extension.Factory extensionsConfigs map[component.ID]component.Config serviceExtensions []component.ID wantErrMsg string @@ -63,10 +63,8 @@ func TestBuildExtensions(t *testing.T) { }, { name: "error_on_create_extension", - factories: component.Factories{ - Extensions: map[component.Type]extension.Factory{ - errExtensionFactory.Type(): errExtensionFactory, - }, + factories: map[component.Type]extension.Factory{ + errExtensionFactory.Type(): errExtensionFactory, }, extensionsConfigs: map[component.ID]component.Config{ component.NewID(errExtensionFactory.Type()): errExtensionConfig, @@ -78,10 +76,8 @@ func TestBuildExtensions(t *testing.T) { }, { name: "bad_factory", - factories: component.Factories{ - Extensions: map[component.Type]extension.Factory{ - badExtensionFactory.Type(): badExtensionFactory, - }, + factories: map[component.Type]extension.Factory{ + badExtensionFactory.Type(): badExtensionFactory, }, extensionsConfigs: map[component.ID]component.Config{ component.NewID(badExtensionFactory.Type()): badExtensionCfg, @@ -99,7 +95,7 @@ func TestBuildExtensions(t *testing.T) { Telemetry: componenttest.NewNopTelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo(), Configs: tt.extensionsConfigs, - Factories: tt.factories.Extensions, + Factories: tt.factories, }, tt.serviceExtensions) require.Error(t, err) assert.EqualError(t, err, tt.wantErrMsg)