1234567891011121314151617181920212223 |
- // Copyright The OpenTelemetry Authors
- // SPDX-License-Identifier: Apache-2.0
- package datadogreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver"
- import (
- "context"
- "testing"
- "github.com/stretchr/testify/assert"
- "go.opentelemetry.io/collector/consumer/consumertest"
- "go.opentelemetry.io/collector/receiver/receivertest"
- )
- func TestCreateReceiver(t *testing.T) {
- factory := NewFactory()
- cfg := factory.CreateDefaultConfig()
- cfg.(*Config).Endpoint = "http://localhost:0"
- tReceiver, err := factory.CreateTracesReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, consumertest.NewNop())
- assert.NoError(t, err)
- assert.NotNil(t, tReceiver, "receiver creation failed")
- }
|