12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- // Copyright The OpenTelemetry Authors
- // SPDX-License-Identifier: Apache-2.0
- package kafkareceiver
- import (
- "testing"
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
- )
- func TestDefaultTracesUnMarshaler(t *testing.T) {
- expectedEncodings := []string{
- "otlp_proto",
- "jaeger_proto",
- "jaeger_json",
- "zipkin_proto",
- "zipkin_json",
- "zipkin_thrift",
- }
- marshalers := defaultTracesUnmarshalers()
- assert.Equal(t, len(expectedEncodings), len(marshalers))
- for _, e := range expectedEncodings {
- t.Run(e, func(t *testing.T) {
- m, ok := marshalers[e]
- require.True(t, ok)
- assert.NotNil(t, m)
- })
- }
- }
- func TestDefaultMetricsUnMarshaler(t *testing.T) {
- expectedEncodings := []string{
- "otlp_proto",
- }
- marshalers := defaultMetricsUnmarshalers()
- assert.Equal(t, len(expectedEncodings), len(marshalers))
- for _, e := range expectedEncodings {
- t.Run(e, func(t *testing.T) {
- m, ok := marshalers[e]
- require.True(t, ok)
- assert.NotNil(t, m)
- })
- }
- }
- func TestDefaultLogsUnMarshaler(t *testing.T) {
- expectedEncodings := []string{
- "otlp_proto",
- "raw",
- "text",
- "json",
- }
- marshalers := defaultLogsUnmarshalers()
- assert.Equal(t, len(expectedEncodings), len(marshalers))
- for _, e := range expectedEncodings {
- t.Run(e, func(t *testing.T) {
- m, ok := marshalers[e]
- require.True(t, ok)
- assert.NotNil(t, m)
- })
- }
- }
|