File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -461,6 +461,10 @@ func serviceConverter(specVersion SpecVersion) func(*Service) {
461461 s .ReleaseNotes = nil
462462 }
463463
464+ if specVersion < SpecVersion1_5 {
465+ s .TrustZone = ""
466+ }
467+
464468 convertOrganizationalEntity (s .Provider , specVersion )
465469 convertExternalReferences (s .ExternalReferences , specVersion )
466470 }
Original file line number Diff line number Diff line change @@ -245,3 +245,33 @@ func Test_convertAuthors(t *testing.T) {
245245 assert .Nil (t , (* bom .Components )[0 ].Authors )
246246 })
247247}
248+
249+ func Test_convertTrustZone (t * testing.T ) {
250+ t .Run ("spec 1.4 and lower" , func (t * testing.T ) {
251+ bom := NewBOM ()
252+ bom .Services = & []Service {
253+ {
254+ Name : "Payment API" ,
255+ TrustZone : "trusted" ,
256+ },
257+ }
258+
259+ bom .convert (SpecVersion1_4 )
260+
261+ assert .Empty (t , (* bom .Services )[0 ].TrustZone )
262+ })
263+
264+ t .Run ("spec 1.5 and higher" , func (t * testing.T ) {
265+ bom := NewBOM ()
266+ bom .Services = & []Service {
267+ {
268+ Name : "Payment API" ,
269+ TrustZone : "trusted" ,
270+ },
271+ }
272+
273+ bom .convert (SpecVersion1_5 )
274+
275+ assert .Equal (t , "trusted" , (* bom .Services )[0 ].TrustZone )
276+ })
277+ }
You can’t perform that action at this time.
0 commit comments