From 58304b678cda5ca741d0fcf2cc61e8119099ae45 Mon Sep 17 00:00:00 2001 From: uturunku1 Date: Mon, 8 Nov 2021 08:58:56 -0800 Subject: [PATCH] import path to go mocks in tfe --- internal/cloud/backend_apply_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/cloud/backend_apply_test.go b/internal/cloud/backend_apply_test.go index 6c4ea4106..f6a9a2cdc 100644 --- a/internal/cloud/backend_apply_test.go +++ b/internal/cloud/backend_apply_test.go @@ -13,6 +13,7 @@ import ( gomock "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" tfe "github.com/hashicorp/go-tfe" + mocks "github.com/hashicorp/go-tfe/mocks" version "github.com/hashicorp/go-version" "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/backend" @@ -576,7 +577,7 @@ func TestCloud_applyAutoApprove(t *testing.T) { defer bCleanup() ctrl := gomock.NewController(t) - applyMock := tfe.NewMockApplies(ctrl) + applyMock := mocks.NewMockApplies(ctrl) // This needs three new lines because we check for a minimum of three lines // in the parsing of logs in `opApply` function. logs := strings.NewReader(applySuccessOneResourceAdded) @@ -778,7 +779,7 @@ func TestCloud_applyWithAutoApprove(t *testing.T) { defer bCleanup() ctrl := gomock.NewController(t) - applyMock := tfe.NewMockApplies(ctrl) + applyMock := mocks.NewMockApplies(ctrl) // This needs three new lines because we check for a minimum of three lines // in the parsing of logs in `opApply` function. logs := strings.NewReader(applySuccessOneResourceAdded) @@ -1269,7 +1270,7 @@ func TestCloud_applyPolicySoftFailAutoApproveSuccess(t *testing.T) { defer bCleanup() ctrl := gomock.NewController(t) - policyCheckMock := tfe.NewMockPolicyChecks(ctrl) + policyCheckMock := mocks.NewMockPolicyChecks(ctrl) // This needs three new lines because we check for a minimum of three lines // in the parsing of logs in `opApply` function. logs := strings.NewReader(fmt.Sprintf("%s\n%s", sentinelSoftFail, applySuccessOneResourceAdded)) @@ -1289,7 +1290,7 @@ func TestCloud_applyPolicySoftFailAutoApproveSuccess(t *testing.T) { policyCheckMock.EXPECT().Logs(gomock.Any(), gomock.Any()).Return(logs, nil) policyCheckMock.EXPECT().Override(gomock.Any(), gomock.Any()).Return(nil, nil) b.client.PolicyChecks = policyCheckMock - applyMock := tfe.NewMockApplies(ctrl) + applyMock := mocks.NewMockApplies(ctrl) // This needs three new lines because we check for a minimum of three lines // in the parsing of logs in `opApply` function. logs = strings.NewReader("\n\n\n1 added, 0 changed, 0 destroyed") @@ -1348,7 +1349,7 @@ func TestCloud_applyPolicySoftFailAutoApprove(t *testing.T) { defer bCleanup() ctrl := gomock.NewController(t) - applyMock := tfe.NewMockApplies(ctrl) + applyMock := mocks.NewMockApplies(ctrl) // This needs three new lines because we check for a minimum of three lines // in the parsing of logs in `opApply` function. logs := strings.NewReader(applySuccessOneResourceAdded)