@@ -153,8 +153,7 @@ func TestDevfile200_SetSetMetadata(t *testing.T) {
153
153
}
154
154
tests := []struct {
155
155
name string
156
- metadataName string
157
- metadataVersion string
156
+ metadata devfilepkg.DevfileMetadata
158
157
devfilev2 * DevfileV2
159
158
expectedDevfilev2 * DevfileV2
160
159
}{
@@ -165,8 +164,10 @@ func TestDevfile200_SetSetMetadata(t *testing.T) {
165
164
DevfileHeader : devfilepkg.DevfileHeader {},
166
165
},
167
166
},
168
- metadataName : "nodejs" ,
169
- metadataVersion : "2.0.0" ,
167
+ metadata : devfilepkg.DevfileMetadata {
168
+ Name : "nodejs" ,
169
+ Version : "2.0.0" ,
170
+ },
170
171
expectedDevfilev2 : & DevfileV2 {
171
172
v1.Devfile {
172
173
DevfileHeader : devfilepkg.DevfileHeader {
@@ -187,15 +188,39 @@ func TestDevfile200_SetSetMetadata(t *testing.T) {
187
188
},
188
189
},
189
190
},
190
- metadataName : "nodejs" ,
191
- metadataVersion : "2.0.0" ,
191
+ metadata : devfilepkg.DevfileMetadata {
192
+ Name : "nodejs" ,
193
+ Version : "2.1.0" ,
194
+ Attributes : attributes.Attributes {}.FromMap (map [string ]interface {}{
195
+ "xyz" : "xyz" ,
196
+ }, nil ),
197
+ DisplayName : "display" ,
198
+ Description : "decription" ,
199
+ Tags : []string {"tag1" },
200
+ Icon : "icon" ,
201
+ GlobalMemoryLimit : "globalmemorylimit" ,
202
+ ProjectType : "projectype" ,
203
+ Language : "language" ,
204
+ Website : "website" ,
205
+ },
192
206
expectedDevfilev2 : & DevfileV2 {
193
207
v1.Devfile {
194
208
DevfileHeader : devfilepkg.DevfileHeader {
195
209
SchemaVersion : "2.0.0" ,
196
210
Metadata : devfilepkg.DevfileMetadata {
197
211
Name : "nodejs" ,
198
- Version : "2.0.0" ,
212
+ Version : "2.1.0" ,
213
+ Attributes : attributes.Attributes {}.FromMap (map [string ]interface {}{
214
+ "xyz" : "xyz" ,
215
+ }, nil ),
216
+ DisplayName : "display" ,
217
+ Description : "decription" ,
218
+ Tags : []string {"tag1" },
219
+ Icon : "icon" ,
220
+ GlobalMemoryLimit : "globalmemorylimit" ,
221
+ ProjectType : "projectype" ,
222
+ Language : "language" ,
223
+ Website : "website" ,
199
224
},
200
225
},
201
226
},
@@ -204,7 +229,7 @@ func TestDevfile200_SetSetMetadata(t *testing.T) {
204
229
}
205
230
for _ , tt := range tests {
206
231
t .Run (tt .name , func (t * testing.T ) {
207
- tt .devfilev2 .SetMetadata (tt .metadataName , tt . metadataVersion )
232
+ tt .devfilev2 .SetMetadata (tt .metadata )
208
233
if ! reflect .DeepEqual (tt .devfilev2 , tt .expectedDevfilev2 ) {
209
234
t .Errorf ("TestDevfile200_SetSchemaVersion() expected %v, got %v" , tt .expectedDevfilev2 , tt .devfilev2 )
210
235
}
0 commit comments