@@ -41,7 +41,7 @@ type mockExecutable struct {
4141 resp * edge.Instance
4242}
4343
44- func (m * mockExecutable ) PostInstancesPayload (_ edge.PostInstancesPayload ) edge.ApiPostInstancesRequest {
44+ func (m * mockExecutable ) CreateInstancePayload (_ edge.CreateInstancePayload ) edge.ApiCreateInstanceRequest {
4545 // This method is needed to satisfy the interface. It allows chaining in buildRequest.
4646 return m
4747}
@@ -57,12 +57,12 @@ func (m *mockExecutable) Execute() (*edge.Instance, error) {
5757
5858// mockAPIClient is a mock for the client.APIClient interface
5959type mockAPIClient struct {
60- postInstancesMock edge.ApiPostInstancesRequest
60+ createInstanceMock edge.ApiCreateInstanceRequest
6161}
6262
63- func (m * mockAPIClient ) PostInstances (_ context.Context , _ , _ string ) edge.ApiPostInstancesRequest {
64- if m .postInstancesMock != nil {
65- return m .postInstancesMock
63+ func (m * mockAPIClient ) CreateInstance (_ context.Context , _ , _ string ) edge.ApiCreateInstanceRequest {
64+ if m .createInstanceMock != nil {
65+ return m .createInstanceMock
6666 }
6767 return & mockExecutable {}
6868}
@@ -80,7 +80,7 @@ func (m *mockAPIClient) GetInstance(_ context.Context, _, _, _ string) edge.ApiG
8080func (m * mockAPIClient ) GetInstanceByName (_ context.Context , _ , _ , _ string ) edge.ApiGetInstanceByNameRequest {
8181 return nil
8282}
83- func (m * mockAPIClient ) GetInstances (_ context.Context , _ , _ string ) edge.ApiGetInstancesRequest {
83+ func (m * mockAPIClient ) ListInstances (_ context.Context , _ , _ string ) edge.ApiListInstancesRequest {
8484 return nil
8585}
8686func (m * mockAPIClient ) UpdateInstance (_ context.Context , _ , _ , _ string ) edge.ApiUpdateInstanceRequest {
@@ -285,13 +285,13 @@ 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 {
292292 ProjectID : testProjectId ,
293293 Region : testRegion ,
294- Payload : edge.PostInstancesPayload {
294+ Payload : edge.CreateInstancePayload {
295295 DisplayName : & testName ,
296296 Description : & testDescription ,
297297 PlanId : & testPlanId ,
@@ -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 },
0 commit comments