NewComponent returns a new Component that can be used for testing.
(tb testing.TB, config *component.Config, opts ...component.Option)
| 23 | |
| 24 | // NewComponent returns a new Component that can be used for testing. |
| 25 | func NewComponent(tb testing.TB, config *component.Config, opts ...component.Option) *component.Component { |
| 26 | c, err := component.New(test.GetLogger(tb), config, opts...) |
| 27 | if err != nil { |
| 28 | tb.Fatalf("Failed to create component: %v", err) |
| 29 | } |
| 30 | return c |
| 31 | } |
| 32 | |
| 33 | // StartComponent starts the component for testing. |
| 34 | func StartComponent(tb testing.TB, c *component.Component) { |