@@ -15,6 +15,10 @@ import (
1515 "go.opentelemetry.io/collector/pdata/pmetric"
1616)
1717
18+ func boolPtr (b bool ) * bool {
19+ return & b
20+ }
21+
1822func TestTwoPackagesInDirectory (t * testing.T ) {
1923 contents , err := os .ReadFile ("testdata/twopackages.yaml" )
2024 require .NoError (t , err )
@@ -70,15 +74,15 @@ func TestLoadMetadata(t *testing.T) {
7074 ResourceAttributes : map [AttributeName ]Attribute {
7175 "string.resource.attr" : {
7276 Description : "Resource attribute with any string value." ,
73- Enabled : true ,
77+ EnabledPtr : boolPtr ( true ) ,
7478 Type : ValueType {
7579 ValueType : pcommon .ValueTypeStr ,
7680 },
7781 FullName : "string.resource.attr" ,
7882 },
7983 "string.enum.resource.attr" : {
8084 Description : "Resource attribute with a known set of string values." ,
81- Enabled : true ,
85+ EnabledPtr : boolPtr ( true ) ,
8286 Enum : []string {"one" , "two" },
8387 Type : ValueType {
8488 ValueType : pcommon .ValueTypeStr ,
@@ -87,23 +91,23 @@ func TestLoadMetadata(t *testing.T) {
8791 },
8892 "optional.resource.attr" : {
8993 Description : "Explicitly disabled ResourceAttribute." ,
90- Enabled : false ,
94+ EnabledPtr : boolPtr ( false ) ,
9195 Type : ValueType {
9296 ValueType : pcommon .ValueTypeStr ,
9397 },
9498 FullName : "optional.resource.attr" ,
9599 },
96100 "slice.resource.attr" : {
97101 Description : "Resource attribute with a slice value." ,
98- Enabled : true ,
102+ EnabledPtr : boolPtr ( true ) ,
99103 Type : ValueType {
100104 ValueType : pcommon .ValueTypeSlice ,
101105 },
102106 FullName : "slice.resource.attr" ,
103107 },
104108 "map.resource.attr" : {
105109 Description : "Resource attribute with a map value." ,
106- Enabled : true ,
110+ EnabledPtr : boolPtr ( true ) ,
107111 Type : ValueType {
108112 ValueType : pcommon .ValueTypeMap ,
109113 },
@@ -114,7 +118,7 @@ func TestLoadMetadata(t *testing.T) {
114118 Warnings : Warnings {
115119 IfEnabledNotSet : "This resource_attribute will be disabled by default soon." ,
116120 },
117- Enabled : true ,
121+ EnabledPtr : boolPtr ( true ) ,
118122 Type : ValueType {
119123 ValueType : pcommon .ValueTypeStr ,
120124 },
@@ -125,7 +129,7 @@ func TestLoadMetadata(t *testing.T) {
125129 Warnings : Warnings {
126130 IfConfigured : "This resource_attribute is deprecated and will be removed soon." ,
127131 },
128- Enabled : false ,
132+ EnabledPtr : boolPtr ( false ) ,
129133 Type : ValueType {
130134 ValueType : pcommon .ValueTypeStr ,
131135 },
@@ -136,7 +140,7 @@ func TestLoadMetadata(t *testing.T) {
136140 Warnings : Warnings {
137141 IfEnabled : "This resource_attribute is deprecated and will be removed soon." ,
138142 },
139- Enabled : true ,
143+ EnabledPtr : boolPtr ( true ) ,
140144 Type : ValueType {
141145 ValueType : pcommon .ValueTypeStr ,
142146 },
0 commit comments