-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
factory_test.go
36 lines (28 loc) · 1.02 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
35
36
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package iisreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/iisreceiver"
import (
"testing"
"time"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/receiver/scraperhelper"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/iisreceiver/internal/metadata"
)
func TestNewFactory(t *testing.T) {
t.Run("NewFactoryCorrectType", func(t *testing.T) {
factory := NewFactory()
require.EqualValues(t, metadata.Type, factory.Type())
})
t.Run("NewFactoryDefaultConfig", func(t *testing.T) {
factory := NewFactory()
var expectedCfg component.Config = &Config{
ControllerConfig: scraperhelper.ControllerConfig{
CollectionInterval: 60 * time.Second,
InitialDelay: time.Second,
},
MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(),
}
require.Equal(t, expectedCfg, factory.CreateDefaultConfig())
})
}