mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
#### Description Testifylint is a linter that provides best practices with the use of testify. This PR enables [require-error](https://github.com/Antonboom/testifylint?tab=readme-ov-file#require-error) rule from [testifylint](https://github.com/Antonboom/testifylint) Signed-off-by: Matthieu MOREL <[email protected]>
32 lines
712 B
Go
32 lines
712 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/configopaque"
|
|
"go.opentelemetry.io/collector/confmap"
|
|
)
|
|
|
|
type TestStruct struct {
|
|
Opaque configopaque.String `json:"opaque" yaml:"opaque"`
|
|
Plain string `json:"plain" yaml:"plain"`
|
|
}
|
|
|
|
var example = TestStruct{
|
|
Opaque: "opaque",
|
|
Plain: "plain",
|
|
}
|
|
|
|
func TestConfMapMarshalConfigOpaque(t *testing.T) {
|
|
conf := confmap.New()
|
|
require.NoError(t, conf.Marshal(example))
|
|
assert.Equal(t, "[REDACTED]", conf.Get("opaque"))
|
|
assert.Equal(t, "plain", conf.Get("plain"))
|
|
}
|