mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This will dramatically reduce YAML output when marshaling config for many receivers and exporters since it's commonly used. <!-- Issue number if applicable --> #### Link to tracking issue Works toward #12191
29 lines
774 B
Go
29 lines
774 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package e2e
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"go.opentelemetry.io/collector/config/configtls"
|
|
"go.opentelemetry.io/collector/confmap"
|
|
)
|
|
|
|
func TestConfmapMarshalConfigTLS(t *testing.T) {
|
|
conf := confmap.New()
|
|
require.NoError(t, conf.Marshal(configtls.NewDefaultConfig()))
|
|
assert.Equal(t, map[string]any{}, conf.ToStringMap())
|
|
|
|
conf = confmap.New()
|
|
require.NoError(t, conf.Marshal(configtls.NewDefaultClientConfig()))
|
|
assert.Equal(t, map[string]any{}, conf.ToStringMap())
|
|
|
|
conf = confmap.New()
|
|
require.NoError(t, conf.Marshal(configtls.NewDefaultServerConfig()))
|
|
assert.Equal(t, map[string]any{}, conf.ToStringMap())
|
|
}
|