pdata_unmarshaler_test.go 786 B

12345678910111213141516171819202122232425262728
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package kafkareceiver
  4. import (
  5. "testing"
  6. "github.com/stretchr/testify/assert"
  7. "go.opentelemetry.io/collector/pdata/plog"
  8. "go.opentelemetry.io/collector/pdata/pmetric"
  9. "go.opentelemetry.io/collector/pdata/ptrace"
  10. )
  11. func TestNewPdataTracesUnmarshaler(t *testing.T) {
  12. um := newPdataTracesUnmarshaler(&ptrace.ProtoUnmarshaler{}, "test")
  13. assert.Equal(t, "test", um.Encoding())
  14. }
  15. func TestNewPdataMetricsUnmarshaler(t *testing.T) {
  16. um := newPdataMetricsUnmarshaler(&pmetric.ProtoUnmarshaler{}, "test")
  17. assert.Equal(t, "test", um.Encoding())
  18. }
  19. func TestNewPdataLogsUnmarshaler(t *testing.T) {
  20. um := newPdataLogsUnmarshaler(&plog.ProtoUnmarshaler{}, "test")
  21. assert.Equal(t, "test", um.Encoding())
  22. }