@@ -4,21 +4,19 @@ 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+ "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
11+ "github.com/stackitcloud/stackit-cli/internal/pkg/testparams"
12+ "github.com/stackitcloud/stackit-cli/internal/pkg/testutils"
13+ runcommand "github.com/stackitcloud/stackit-sdk-go/services/runcommand/v2api"
1614)
1715
1816type testCtxKey struct {}
1917
2018var testCtx = context .WithValue (context .Background (), testCtxKey {}, "foo" )
21- var testClient = & runcommand.APIClient {}
19+ var testClient = & runcommand.APIClient {DefaultAPI : & runcommand. DefaultAPIService {} }
2220
2321var testProjectId = uuid .NewString ()
2422var testServerId = uuid .NewString ()
@@ -59,7 +57,7 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
5957}
6058
6159func fixtureRequest (mods ... func (request * runcommand.ApiCreateCommandRequest )) runcommand.ApiCreateCommandRequest {
62- request := testClient .CreateCommand (testCtx , testProjectId , testServerId , testRegion )
60+ request := testClient .DefaultAPI . CreateCommand (testCtx , testProjectId , testServerId , testRegion )
6361 request = request .CreateCommandPayload (fixturePayload ())
6462 for _ , mod := range mods {
6563 mod (& request )
@@ -69,7 +67,7 @@ func fixtureRequest(mods ...func(request *runcommand.ApiCreateCommandRequest)) r
6967
7068func fixturePayload (mods ... func (payload * runcommand.CreateCommandPayload )) runcommand.CreateCommandPayload {
7169 payload := runcommand.CreateCommandPayload {
72- CommandTemplateName : utils . Ptr ( "RunShellScript" ) ,
70+ CommandTemplateName : "RunShellScript" ,
7371 Parameters : & map [string ]string {"script" : "'echo hello'" },
7472 }
7573 for _ , mod := range mods {
@@ -170,7 +168,7 @@ func TestBuildRequest(t *testing.T) {
170168
171169 diff := cmp .Diff (request , tt .expectedRequest ,
172170 cmp .AllowUnexported (tt .expectedRequest ),
173- cmpopts .EquateComparable (testCtx ),
171+ cmpopts .EquateComparable (testCtx , runcommand. DefaultAPIService {} ),
174172 )
175173 if diff != "" {
176174 t .Fatalf ("Data does not match: %s" , diff )
0 commit comments