-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
factory_test.go
34 lines (27 loc) · 1.08 KB
/
factory_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package azureeventhubreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver"
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/receiver/receivertest"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/azureeventhubreceiver/internal/metadata"
)
func Test_NewFactory(t *testing.T) {
f := NewFactory()
assert.Equal(t, metadata.Type, f.Type())
}
func Test_NewLogsReceiver(t *testing.T) {
f := NewFactory()
receiver, err := f.CreateLogs(context.Background(), receivertest.NewNopSettings(), f.CreateDefaultConfig(), consumertest.NewNop())
assert.NoError(t, err)
assert.NotNil(t, receiver)
}
func Test_NewMetricsReceiver(t *testing.T) {
f := NewFactory()
receiver, err := f.CreateMetrics(context.Background(), receivertest.NewNopSettings(), f.CreateDefaultConfig(), consumertest.NewNop())
assert.NoError(t, err)
assert.NotNil(t, receiver)
}