File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1- v0.5.0-dev
1+ v0.5.1
Original file line number Diff line number Diff line change 55 "testing"
66
77 "github.com/stretchr/testify/assert"
8+ "k8s.io/apimachinery/pkg/util/json"
89 "k8s.io/utils/ptr"
910
1011 ocmcli "github.com/openmcp-project/bootstrapper/internal/ocm-cli"
@@ -114,6 +115,19 @@ func TestGetComponentVersion(t *testing.T) {
114115 MediaType : ptr .To ("application/octet-stream" ),
115116 },
116117 })
118+
119+ cvMarshaled , err := json .Marshal (cv )
120+ assert .NoError (t , err )
121+ assert .NotNil (t , cvMarshaled )
122+
123+ var cvAsMap map [string ]interface {}
124+ err = json .Unmarshal (cvMarshaled , & cvAsMap )
125+ assert .NoError (t , err )
126+ assert .NotNil (t , cvAsMap )
127+ assert .Contains (t , cvAsMap , "component" )
128+ assert .Contains (t , cvAsMap ["component" ], "componentReferences" )
129+ comp := cvAsMap ["component" ].(map [string ]interface {})
130+ assert .Len (t , comp ["componentReferences" ], 2 )
117131 },
118132 },
119133 {
You can’t perform that action at this time.
0 commit comments