| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
package otlp |
| 5 |
|
| 6 |
import ( |
| 7 |
"testing" |
| 8 |
|
| 9 |
"github.com/stretchr/testify/assert" |
| 10 |
|
| 11 |
"go.opentelemetry.io/collector/pdata/internal" |
| 12 |
) |
| 13 |
|
| 14 |
func TestDeprecatedScopeSpans(t *testing.T) { |
| 15 |
ss := new(internal.ScopeSpans) |
| 16 |
rss := []*internal.ResourceSpans{ |
| 17 |
{ |
| 18 |
ScopeSpans: []*internal.ScopeSpans{ss}, |
| 19 |
DeprecatedScopeSpans: []*internal.ScopeSpans{ss}, |
| 20 |
}, |
| 21 |
{ |
| 22 |
ScopeSpans: []*internal.ScopeSpans{}, |
| 23 |
DeprecatedScopeSpans: []*internal.ScopeSpans{ss}, |
| 24 |
}, |
| 25 |
} |
| 26 |
|
| 27 |
MigrateTraces(rss) |
| 28 |
assert.Same(t, ss, rss[0].ScopeSpans[0]) |
| 29 |
assert.Same(t, ss, rss[1].ScopeSpans[0]) |
| 30 |
assert.Nil(t, rss[0].DeprecatedScopeSpans) |
| 31 |
assert.Nil(t, rss[0].DeprecatedScopeSpans) |
| 32 |
} |