diff --git a/pdata/pcommon/common_test.go b/pdata/pcommon/common_test.go index 61583bcfe7f..9bb7a3f8fcb 100644 --- a/pdata/pcommon/common_test.go +++ b/pdata/pcommon/common_test.go @@ -74,14 +74,14 @@ func TestValueMap(t *testing.T) { assert.Equal(t, NewMap(), m1.Map()) assert.Equal(t, 0, m1.Map().Len()) - m1.MapVal().PutDouble("double_key", 123) - assert.Equal(t, 1, m1.MapVal().Len()) - got, exists := m1.MapVal().Get("double_key") + m1.Map().PutDouble("double_key", 123) + assert.Equal(t, 1, m1.Map().Len()) + got, exists := m1.Map().Get("double_key") assert.True(t, exists) assert.Equal(t, NewValueDouble(123), got) // Create a second map. - m2 := m1.MapVal().PutEmptyMap("child_map") + m2 := m1.Map().PutEmptyMap("child_map") assert.Equal(t, 0, m2.Len()) // Modify the source map that was inserted. @@ -92,13 +92,13 @@ func TestValueMap(t *testing.T) { assert.Equal(t, NewValueString("somestr"), got) // Insert the second map as a child. This should perform a deep copy. - assert.EqualValues(t, 2, m1.MapVal().Len()) - got, exists = m1.MapVal().Get("double_key") + assert.EqualValues(t, 2, m1.Map().Len()) + got, exists = m1.Map().Get("double_key") assert.True(t, exists) assert.Equal(t, NewValueDouble(123), got) got, exists = m1.Map().Get("child_map") assert.True(t, exists) - assert.Equal(t, m2, got.MapVal()) + assert.Equal(t, m2, got.Map()) // Modify the source map m2 that was inserted into m1. m2.PutString("key_in_child", "somestr2") @@ -108,16 +108,16 @@ func TestValueMap(t *testing.T) { assert.Equal(t, NewValueString("somestr2"), got) // The child map inside m1 should be modified. - childMap, childMapExists := m1.MapVal().Get("child_map") + childMap, childMapExists := m1.Map().Get("child_map") require.True(t, childMapExists) got, exists = childMap.Map().Get("key_in_child") require.True(t, exists) assert.Equal(t, NewValueString("somestr2"), got) // Now modify the inserted map (not the source) - childMap.MapVal().PutString("key_in_child", "somestr3") - assert.EqualValues(t, 1, childMap.MapVal().Len()) - got, exists = childMap.MapVal().Get("key_in_child") + childMap.Map().PutString("key_in_child", "somestr3") + assert.EqualValues(t, 1, childMap.Map().Len()) + got, exists = childMap.Map().Get("key_in_child") require.True(t, exists) assert.Equal(t, NewValueString("somestr3"), got)