Skip to content

Commit

Permalink
[chore] remove usage of component.Factories in service/extiension (#6674
Browse files Browse the repository at this point in the history
)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu authored Dec 5, 2022
1 parent b4ff8ba commit 4ef513d
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions service/extensions/extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit 4ef513d

Please sign in to comment.