@@ -19,7 +19,6 @@ import (
1919 "github.com/stackitcloud/stackit-cli/internal/pkg/globalflags"
2020 "github.com/stackitcloud/stackit-cli/internal/pkg/testparams"
2121 "github.com/stackitcloud/stackit-cli/internal/pkg/testutils"
22- "github.com/stackitcloud/stackit-cli/internal/pkg/utils"
2322)
2423
2524type testCtxKey struct {}
@@ -55,7 +54,7 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
5554 Region : testRegion ,
5655 Verbosity : globalflags .VerbosityDefault ,
5756 },
58- Limit : utils . Ptr (testLimit ),
57+ Limit : new (testLimit ),
5958 }
6059 for _ , mod := range mods {
6160 mod (model )
@@ -141,7 +140,7 @@ func TestBuildRequest(t *testing.T) {
141140 }
142141 for _ , tt := range tests {
143142 t .Run (tt .description , func (t * testing.T ) {
144- request := buildRequest (testCtx , tt .model , testClient , 1 , testLimit )
143+ request := buildRequest (testCtx , tt .model , testClient . DefaultAPI , 1 , testLimit )
145144
146145 diff := cmp .Diff (request , tt .expectedRequest ,
147146 cmp .AllowUnexported (tt .expectedRequest , scf.DefaultAPIService {}),
@@ -188,21 +187,21 @@ func TestFetchOrganizations(t *testing.T) {
188187 },
189188 {
190189 description : "stops at totalPages" ,
191- responses : []scf.OrganizationsList {fixturePage (100 , utils . Ptr (int64 (1 )))},
190+ responses : []scf.OrganizationsList {fixturePage (100 , new (int64 (1 )))},
192191 expectedCount : 100 ,
193192 expectedRequests : []string {"page=1 perPage=100" },
194193 },
195194 {
196195 description : "limit below page size" ,
197- limit : utils . Ptr (int64 (10 )),
196+ limit : new (int64 (10 )),
198197 responses : []scf.OrganizationsList {fixturePage (10 , nil )},
199198 expectedCount : 10 ,
200199 expectedRequests : []string {"page=1 perPage=10" },
201200 },
202201 {
203202 // perPage must not shrink on the last page, the API pages by offset
204203 description : "limit across pages" ,
205- limit : utils . Ptr (int64 (150 )),
204+ limit : new (int64 (150 )),
206205 responses : []scf.OrganizationsList {
207206 fixturePage (100 , nil ),
208207 fixturePage (100 , nil ),
@@ -314,9 +313,9 @@ func TestOutputResult(t *testing.T) {
314313 organizations : []scf.OrganizationsListItem {
315314 {
316315 Guid : testOrganization ,
317- Name : utils . Ptr ("my-org" ),
316+ Name : new ("my - org "),
318317 Status : "active" ,
319- CreatedAt : utils . Ptr (time .Now ()),
318+ CreatedAt : new (time.Now ()),
320319 },
321320 },
322321 },
0 commit comments