@@ -4,21 +4,20 @@ import (
44 "context"
55 "testing"
66
7- "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
8- "github.com/stackitcloud/stackit-cli/internal/pkg/testparams"
9- "github.com/stackitcloud/stackit-cli/internal/pkg/testutils"
10- "github.com/stackitcloud/stackit-cli/internal/pkg/utils"
11-
127 "github.com/google/go-cmp/cmp"
138 "github.com/google/go-cmp/cmp/cmpopts"
149 "github.com/google/uuid"
15- "github.com/stackitcloud/stackit-sdk-go/services/runcommand"
10+ runcommand "github.com/stackitcloud/stackit-sdk-go/services/runcommand/v2api"
11+
12+ "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
13+ "github.com/stackitcloud/stackit-cli/internal/pkg/testparams"
14+ "github.com/stackitcloud/stackit-cli/internal/pkg/testutils"
1615)
1716
1817type testCtxKey struct {}
1918
2019var testCtx = context .WithValue (context .Background (), testCtxKey {}, "foo" )
21- var testClient = & runcommand.APIClient {}
20+ var testClient = & runcommand.APIClient {DefaultAPI : & runcommand. DefaultAPIService {} }
2221
2322var testProjectId = uuid .NewString ()
2423var testServerId = uuid .NewString ()
@@ -59,7 +58,7 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
5958}
6059
6160func fixtureRequest (mods ... func (request * runcommand.ApiCreateCommandRequest )) runcommand.ApiCreateCommandRequest {
62- request := testClient .CreateCommand (testCtx , testProjectId , testServerId , testRegion )
61+ request := testClient .DefaultAPI . CreateCommand (testCtx , testProjectId , testServerId , testRegion )
6362 request = request .CreateCommandPayload (fixturePayload ())
6463 for _ , mod := range mods {
6564 mod (& request )
@@ -69,7 +68,7 @@ func fixtureRequest(mods ...func(request *runcommand.ApiCreateCommandRequest)) r
6968
7069func fixturePayload (mods ... func (payload * runcommand.CreateCommandPayload )) runcommand.CreateCommandPayload {
7170 payload := runcommand.CreateCommandPayload {
72- CommandTemplateName : utils . Ptr ( "RunShellScript" ) ,
71+ CommandTemplateName : "RunShellScript" ,
7372 Parameters : & map [string ]string {"script" : "'echo hello'" },
7473 }
7574 for _ , mod := range mods {
@@ -170,7 +169,7 @@ func TestBuildRequest(t *testing.T) {
170169
171170 diff := cmp .Diff (request , tt .expectedRequest ,
172171 cmp .AllowUnexported (tt .expectedRequest ),
173- cmpopts .EquateComparable (testCtx ),
172+ cmpopts .EquateComparable (testCtx , runcommand. DefaultAPIService {} ),
174173 )
175174 if diff != "" {
176175 t .Fatalf ("Data does not match: %s" , diff )
0 commit comments