@@ -13,13 +13,13 @@ import (
1313 "github.com/google/go-cmp/cmp"
1414 "github.com/google/go-cmp/cmp/cmpopts"
1515 "github.com/google/uuid"
16- "github.com/stackitcloud/stackit-sdk-go/services/objectstorage"
16+ objectstorage "github.com/stackitcloud/stackit-sdk-go/services/objectstorage/v2api "
1717)
1818
1919type testCtxKey struct {}
2020
2121var testCtx = context .WithValue (context .Background (), testCtxKey {}, "foo" )
22- var testClient = & objectstorage.APIClient {}
22+ var testClient = & objectstorage.APIClient {DefaultAPI : & objectstorage. DefaultAPIService {} }
2323var testProjectId = uuid .NewString ()
2424
2525const (
@@ -64,7 +64,7 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
6464}
6565
6666func fixtureRequest (mods ... func (request * objectstorage.ApiGetBucketRequest )) objectstorage.ApiGetBucketRequest {
67- request := testClient .GetBucket (testCtx , testProjectId , testRegion , testBucketName )
67+ request := testClient .DefaultAPI . GetBucket (testCtx , testProjectId , testRegion , testBucketName )
6868 for _ , mod := range mods {
6969 mod (& request )
7070 }
@@ -161,7 +161,7 @@ func TestBuildRequest(t *testing.T) {
161161 request := buildRequest (testCtx , tt .model , testClient )
162162
163163 diff := cmp .Diff (request , tt .expectedRequest ,
164- cmp .AllowUnexported (tt .expectedRequest ),
164+ cmp .AllowUnexported (tt .expectedRequest , objectstorage. DefaultAPIService {} ),
165165 cmpopts .EquateComparable (testCtx ),
166166 )
167167 if diff != "" {
@@ -174,7 +174,7 @@ func TestBuildRequest(t *testing.T) {
174174func TestOutputResult (t * testing.T ) {
175175 type args struct {
176176 outputFormat string
177- bucket * objectstorage.Bucket
177+ resp * objectstorage.GetBucketResponse
178178 }
179179 tests := []struct {
180180 name string
@@ -187,9 +187,9 @@ func TestOutputResult(t *testing.T) {
187187 wantErr : true ,
188188 },
189189 {
190- name : "set empty bucket " ,
190+ name : "set empty response " ,
191191 args : args {
192- bucket : & objectstorage.Bucket {},
192+ resp : & objectstorage.GetBucketResponse {},
193193 },
194194 wantErr : false ,
195195 },
@@ -198,7 +198,7 @@ func TestOutputResult(t *testing.T) {
198198 p .Cmd = NewCmd (& types.CmdParams {Printer : p })
199199 for _ , tt := range tests {
200200 t .Run (tt .name , func (t * testing.T ) {
201- if err := outputResult (p , tt .args .outputFormat , tt .args .bucket ); (err != nil ) != tt .wantErr {
201+ if err := outputResult (p , tt .args .outputFormat , tt .args .resp ); (err != nil ) != tt .wantErr {
202202 t .Errorf ("outputResult() error = %v, wantErr %v" , err , tt .wantErr )
203203 }
204204 })
0 commit comments