| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
package extensiontest |
| 5 |
|
| 6 |
import ( |
| 7 |
"context" |
| 8 |
"testing" |
| 9 |
|
| 10 |
"github.com/stretchr/testify/assert" |
| 11 |
"github.com/stretchr/testify/require" |
| 12 |
|
| 13 |
"go.opentelemetry.io/collector/component" |
| 14 |
"go.opentelemetry.io/collector/component/componenttest" |
| 15 |
) |
| 16 |
|
| 17 |
func TestNewNopFactory(t *testing.T) { |
| 18 |
factory := NewNopFactory() |
| 19 |
require.NotNil(t, factory) |
| 20 |
assert.Equal(t, component.MustNewType("nop"), factory.Type()) |
| 21 |
cfg := factory.CreateDefaultConfig() |
| 22 |
assert.Equal(t, &nopConfig{}, cfg) |
| 23 |
|
| 24 |
traces, err := factory.Create(context.Background(), NewNopSettings(NopType), cfg) |
| 25 |
require.NoError(t, err) |
| 26 |
assert.NoError(t, traces.Start(context.Background(), componenttest.NewNopHost())) |
| 27 |
assert.NoError(t, traces.Shutdown(context.Background())) |
| 28 |
} |