From 795d9b029749a07d34d658b0ec294c3e344ad023 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 25 Jan 2023 15:43:37 -0800 Subject: [PATCH] Increase components test in the builder generated code Signed-off-by: Bogdan Drutu --- .../builder/templates/components_test.go.tmpl | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cmd/builder/internal/builder/templates/components_test.go.tmpl b/cmd/builder/internal/builder/templates/components_test.go.tmpl index d53206a4507..aaf9ee8b965 100644 --- a/cmd/builder/internal/builder/templates/components_test.go.tmpl +++ b/cmd/builder/internal/builder/templates/components_test.go.tmpl @@ -12,19 +12,28 @@ func TestValidateConfigs(t *testing.T) { factories, err := components() assert.NoError(t, err) - for _, factory := range factories.Receivers { + for k, factory := range factories.Receivers { + assert.Equal(t, k, factory.Type()) assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) } - for _, factory := range factories.Processors { + + for k, factory := range factories.Processors { + assert.Equal(t, k, factory.Type()) assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) } - for _, factory := range factories.Exporters { + + for k, factory := range factories.Exporters { + assert.Equal(t, k, factory.Type()) assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) } - for _, factory := range factories.Extensions { + + for k, factory := range factories.Connectors { + assert.Equal(t, k, factory.Type()) assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) } - for _, factory := range factories.Connectors { + + for k, factory := range factories.Extensions { + assert.Equal(t, k, factory.Type()) assert.NoError(t, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) } }