Skip to content

Commit 62cb4c5

Browse files
authored
Update to stackit-sdk-go/services/edge v0.3.0 (#1231)
1 parent 1931b74 commit 62cb4c5

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

internal/cmd/beta/edge/instance/create/create_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ func (m *mockExecutable) Execute() (*edge.Instance, error) {
5757

5858
// mockAPIClient is a mock for the client.APIClient interface
5959
type mockAPIClient struct {
60-
postInstancesMock edge.ApiCreateInstanceRequest
60+
createInstanceMock edge.ApiCreateInstanceRequest
6161
}
6262

6363
func (m *mockAPIClient) CreateInstance(_ context.Context, _, _ string) edge.ApiCreateInstanceRequest {
64-
if m.postInstancesMock != nil {
65-
return m.postInstancesMock
64+
if m.createInstanceMock != nil {
65+
return m.createInstanceMock
6666
}
6767
return &mockExecutable{}
6868
}
@@ -285,7 +285,7 @@ func TestBuildRequest(t *testing.T) {
285285
args: args{
286286
model: fixtureInputModel(),
287287
client: &mockAPIClient{
288-
postInstancesMock: &mockExecutable{},
288+
createInstanceMock: &mockExecutable{},
289289
},
290290
},
291291
want: &createRequestSpec{
@@ -331,7 +331,7 @@ func TestRun(t *testing.T) {
331331
args: args{
332332
model: fixtureInputModel(),
333333
client: &mockAPIClient{
334-
postInstancesMock: &mockExecutable{
334+
createInstanceMock: &mockExecutable{
335335
resp: &edge.Instance{Id: &testInstanceId},
336336
},
337337
},
@@ -343,7 +343,7 @@ func TestRun(t *testing.T) {
343343
args: args{
344344
model: fixtureInputModel(),
345345
client: &mockAPIClient{
346-
postInstancesMock: &mockExecutable{
346+
createInstanceMock: &mockExecutable{
347347
executeFails: true,
348348
},
349349
},

internal/cmd/beta/edge/instance/list/list_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ func (m *mockExecutable) Execute() (*edge.InstanceList, error) {
5252

5353
// mockAPIClient is a mock for the edge.APIClient interface
5454
type mockAPIClient struct {
55-
getInstancesMock edge.ApiListInstancesRequest
55+
listInstancesMock edge.ApiListInstancesRequest
5656
}
5757

5858
func (m *mockAPIClient) ListInstances(_ context.Context, _, _ string) edge.ApiListInstancesRequest {
59-
if m.getInstancesMock != nil {
60-
return m.getInstancesMock
59+
if m.listInstancesMock != nil {
60+
return m.listInstancesMock
6161
}
6262
return &mockExecutable{}
6363
}
@@ -291,7 +291,7 @@ func TestRun(t *testing.T) {
291291
args: args{
292292
model: fixtureInputModel(),
293293
client: &mockAPIClient{
294-
getInstancesMock: &mockExecutable{
294+
listInstancesMock: &mockExecutable{
295295
executeResp: &edge.InstanceList{Instances: &[]edge.Instance{}},
296296
},
297297
},
@@ -303,7 +303,7 @@ func TestRun(t *testing.T) {
303303
args: args{
304304
model: fixtureInputModel(),
305305
client: &mockAPIClient{
306-
getInstancesMock: &mockExecutable{
306+
listInstancesMock: &mockExecutable{
307307
executeFails: true,
308308
},
309309
},
@@ -426,7 +426,7 @@ func TestBuildRequest(t *testing.T) {
426426
args: args{
427427
model: fixtureInputModel(),
428428
client: &mockAPIClient{
429-
getInstancesMock: &mockExecutable{},
429+
listInstancesMock: &mockExecutable{},
430430
},
431431
},
432432
},
@@ -442,7 +442,7 @@ func TestBuildRequest(t *testing.T) {
442442
model.Limit = utils.Ptr(int64(10))
443443
}),
444444
client: &mockAPIClient{
445-
getInstancesMock: &mockExecutable{},
445+
listInstancesMock: &mockExecutable{},
446446
},
447447
},
448448
},

internal/pkg/services/edge/client/client.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ import (
1515

1616
// APIClient is an interface that consolidates all client functionality to allow for mocking of the API client during testing.
1717
type APIClient interface {
18-
CreateInstance(ctx context.Context, projectId, region string) edge.ApiCreateInstanceRequest
19-
DeleteInstance(ctx context.Context, projectId, region, instanceId string) edge.ApiDeleteInstanceRequest
20-
DeleteInstanceByName(ctx context.Context, projectId, region, instanceName string) edge.ApiDeleteInstanceByNameRequest
21-
GetInstance(ctx context.Context, projectId, region, instanceId string) edge.ApiGetInstanceRequest
22-
GetInstanceByName(ctx context.Context, projectId, region, instanceName string) edge.ApiGetInstanceByNameRequest
23-
ListInstances(ctx context.Context, projectId, region string) edge.ApiListInstancesRequest
24-
UpdateInstance(ctx context.Context, projectId, region, instanceId string) edge.ApiUpdateInstanceRequest
25-
UpdateInstanceByName(ctx context.Context, projectId, region, instanceName string) edge.ApiUpdateInstanceByNameRequest
26-
GetKubeconfigByInstanceId(ctx context.Context, projectId, region, instanceId string) edge.ApiGetKubeconfigByInstanceIdRequest
27-
GetKubeconfigByInstanceName(ctx context.Context, projectId, region, instanceName string) edge.ApiGetKubeconfigByInstanceNameRequest
28-
GetTokenByInstanceId(ctx context.Context, projectId, region, instanceId string) edge.ApiGetTokenByInstanceIdRequest
29-
GetTokenByInstanceName(ctx context.Context, projectId, region, instanceName string) edge.ApiGetTokenByInstanceNameRequest
18+
CreateInstance(ctx context.Context, projectId, regionId string) edge.ApiCreateInstanceRequest
19+
DeleteInstance(ctx context.Context, projectId, regionId, instanceId string) edge.ApiDeleteInstanceRequest
20+
DeleteInstanceByName(ctx context.Context, projectId, regionId, displayName string) edge.ApiDeleteInstanceByNameRequest
21+
GetInstance(ctx context.Context, projectId, regionId, instanceId string) edge.ApiGetInstanceRequest
22+
GetInstanceByName(ctx context.Context, projectId, regionId, displayName string) edge.ApiGetInstanceByNameRequest
23+
ListInstances(ctx context.Context, projectId, regionId string) edge.ApiListInstancesRequest
24+
UpdateInstance(ctx context.Context, projectId, regionId, instanceId string) edge.ApiUpdateInstanceRequest
25+
UpdateInstanceByName(ctx context.Context, projectId, regionId, displayName string) edge.ApiUpdateInstanceByNameRequest
26+
GetKubeconfigByInstanceId(ctx context.Context, projectId, regionId, instanceId string) edge.ApiGetKubeconfigByInstanceIdRequest
27+
GetKubeconfigByInstanceName(ctx context.Context, projectId, regionId, displayName string) edge.ApiGetKubeconfigByInstanceNameRequest
28+
GetTokenByInstanceId(ctx context.Context, projectId, regionId, instanceId string) edge.ApiGetTokenByInstanceIdRequest
29+
GetTokenByInstanceName(ctx context.Context, projectId, regionId, displayName string) edge.ApiGetTokenByInstanceNameRequest
3030
ListPlansProject(ctx context.Context, projectId string) edge.ApiListPlansProjectRequest
3131
}
3232

0 commit comments

Comments
 (0)