Skip to content

Commit 75110e9

Browse files
committed
adjust test cases
1 parent 76c79de commit 75110e9

15 files changed

+44
-49
lines changed

pkg/backend/endpoint_resolver_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"k8s.io/apimachinery/pkg/types"
1616
"k8s.io/apimachinery/pkg/util/intstr"
1717
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
18-
mock_k8s "sigs.k8s.io/aws-load-balancer-controller/mocks/k8s"
1918
"sigs.k8s.io/aws-load-balancer-controller/pkg/equality"
2019
"sigs.k8s.io/aws-load-balancer-controller/pkg/k8s"
2120
ctrl "sigs.k8s.io/controller-runtime"
@@ -776,7 +775,7 @@ func Test_defaultEndpointResolver_ResolvePodEndpoints(t *testing.T) {
776775
t.Run(tt.name, func(t *testing.T) {
777776
ctrl := gomock.NewController(t)
778777
defer ctrl.Finish()
779-
podInfoRepo := mock_k8s.NewMockPodInfoRepo(ctrl)
778+
podInfoRepo := k8s.NewMockPodInfoRepo(ctrl)
780779
for _, call := range tt.fields.podInfoRepoGetCalls {
781780
podInfoRepo.EXPECT().Get(gomock.Any(), call.key).Return(call.pod, call.exists, call.err)
782781
}

pkg/deploy/ec2/tagging_manager_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import (
88
"github.com/google/go-cmp/cmp"
99
"github.com/google/go-cmp/cmp/cmpopts"
1010
"github.com/stretchr/testify/assert"
11-
mock_services "sigs.k8s.io/aws-load-balancer-controller/mocks/aws/services"
12-
mock_networking "sigs.k8s.io/aws-load-balancer-controller/mocks/networking"
11+
"sigs.k8s.io/aws-load-balancer-controller/pkg/aws/services"
1312
"sigs.k8s.io/aws-load-balancer-controller/pkg/deploy/tracking"
1413
"sigs.k8s.io/aws-load-balancer-controller/pkg/networking"
1514
"sigs.k8s.io/controller-runtime/pkg/log"
@@ -154,7 +153,7 @@ func Test_defaultTaggingManager_ReconcileTags(t *testing.T) {
154153
t.Run(tt.name, func(t *testing.T) {
155154
ctrl := gomock.NewController(t)
156155
defer ctrl.Finish()
157-
ec2Client := mock_services.NewMockEC2(ctrl)
156+
ec2Client := services.NewMockEC2(ctrl)
158157
for _, call := range tt.fields.createTagsWithContextCalls {
159158
ec2Client.EXPECT().CreateTagsWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
160159
}
@@ -411,7 +410,7 @@ func Test_defaultTaggingManager_ListSecurityGroups(t *testing.T) {
411410
ctrl := gomock.NewController(t)
412411
defer ctrl.Finish()
413412

414-
networkingSGManager := mock_networking.NewMockSecurityGroupManager(ctrl)
413+
networkingSGManager := networking.NewMockSecurityGroupManager(ctrl)
415414
for _, call := range tt.fields.fetchSGInfosByRequestCalls {
416415
networkingSGManager.EXPECT().FetchSGInfosByRequest(gomock.Any(), call.req).Return(call.resp, call.err)
417416
}

pkg/deploy/elbv2/load_balancer_attributes_reconciler_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/golang/mock/gomock"
88
"github.com/pkg/errors"
99
"github.com/stretchr/testify/assert"
10-
mock_services "sigs.k8s.io/aws-load-balancer-controller/mocks/aws/services"
10+
"sigs.k8s.io/aws-load-balancer-controller/pkg/aws/services"
1111
coremodel "sigs.k8s.io/aws-load-balancer-controller/pkg/model/core"
1212
elbv2model "sigs.k8s.io/aws-load-balancer-controller/pkg/model/elbv2"
1313
"sigs.k8s.io/controller-runtime/pkg/log"
@@ -154,7 +154,7 @@ func Test_defaultLoadBalancerAttributeReconciler_updateSDKLoadBalancerWithAttrib
154154
t.Run(tt.name, func(t *testing.T) {
155155
ctrl := gomock.NewController(t)
156156
defer ctrl.Finish()
157-
elbv2Client := mock_services.NewMockELBV2(ctrl)
157+
elbv2Client := services.NewMockELBV2(ctrl)
158158
for _, call := range tt.fields.describeLoadBalancerAttributesWithContextCalls {
159159
elbv2Client.EXPECT().DescribeLoadBalancerAttributesWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
160160
}
@@ -310,7 +310,7 @@ func Test_defaultLoadBalancerAttributeReconciler_getCurrentLoadBalancerAttribute
310310
t.Run(tt.name, func(t *testing.T) {
311311
ctrl := gomock.NewController(t)
312312
defer ctrl.Finish()
313-
elbv2Client := mock_services.NewMockELBV2(ctrl)
313+
elbv2Client := services.NewMockELBV2(ctrl)
314314
for _, call := range tt.fields.describeLoadBalancerAttributesWithContextCalls {
315315
elbv2Client.EXPECT().DescribeLoadBalancerAttributesWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
316316
}

pkg/deploy/elbv2/tagging_manager_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
elbv2sdk "github.com/aws/aws-sdk-go/service/elbv2"
77
"github.com/golang/mock/gomock"
88
"github.com/stretchr/testify/assert"
9-
mock_services "sigs.k8s.io/aws-load-balancer-controller/mocks/aws/services"
9+
"sigs.k8s.io/aws-load-balancer-controller/pkg/aws/services"
1010
"sigs.k8s.io/aws-load-balancer-controller/pkg/deploy/tracking"
1111
"sigs.k8s.io/controller-runtime/pkg/log"
1212
"testing"
@@ -213,7 +213,7 @@ func Test_defaultTaggingManager_ReconcileTags(t *testing.T) {
213213
t.Run(tt.name, func(t *testing.T) {
214214
ctrl := gomock.NewController(t)
215215
defer ctrl.Finish()
216-
elbv2Client := mock_services.NewMockELBV2(ctrl)
216+
elbv2Client := services.NewMockELBV2(ctrl)
217217
for _, call := range tt.fields.describeTagsWithContextCalls {
218218
elbv2Client.EXPECT().DescribeTagsWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
219219
}
@@ -442,7 +442,7 @@ func Test_defaultTaggingManager_ListLoadBalancers(t *testing.T) {
442442
t.Run(tt.name, func(t *testing.T) {
443443
ctrl := gomock.NewController(t)
444444
defer ctrl.Finish()
445-
elbv2Client := mock_services.NewMockELBV2(ctrl)
445+
elbv2Client := services.NewMockELBV2(ctrl)
446446
for _, call := range tt.fields.describeLoadBalancersAsListCalls {
447447
elbv2Client.EXPECT().DescribeLoadBalancersAsList(gomock.Any(), call.req).Return(call.resp, call.err)
448448
}
@@ -788,7 +788,7 @@ func Test_defaultTaggingManager_ListTargetGroups(t *testing.T) {
788788
t.Run(tt.name, func(t *testing.T) {
789789
ctrl := gomock.NewController(t)
790790
defer ctrl.Finish()
791-
elbv2Client := mock_services.NewMockELBV2(ctrl)
791+
elbv2Client := services.NewMockELBV2(ctrl)
792792
for _, call := range tt.fields.describeTargetGroupsAsListCalls {
793793
elbv2Client.EXPECT().DescribeTargetGroupsAsList(gomock.Any(), call.req).Return(call.resp, call.err)
794794
}
@@ -954,7 +954,7 @@ func Test_defaultTaggingManager_describeResourceTags(t *testing.T) {
954954
t.Run(tt.name, func(t *testing.T) {
955955
ctrl := gomock.NewController(t)
956956
defer ctrl.Finish()
957-
elbv2Client := mock_services.NewMockELBV2(ctrl)
957+
elbv2Client := services.NewMockELBV2(ctrl)
958958
for _, call := range tt.fields.describeTagsWithContextCalls {
959959
elbv2Client.EXPECT().DescribeTagsWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
960960
}

pkg/deploy/elbv2/target_group_attributes_reconciler_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/golang/mock/gomock"
88
"github.com/pkg/errors"
99
"github.com/stretchr/testify/assert"
10-
mock_services "sigs.k8s.io/aws-load-balancer-controller/mocks/aws/services"
10+
"sigs.k8s.io/aws-load-balancer-controller/pkg/aws/services"
1111
coremodel "sigs.k8s.io/aws-load-balancer-controller/pkg/model/core"
1212
elbv2model "sigs.k8s.io/aws-load-balancer-controller/pkg/model/elbv2"
1313
"sigs.k8s.io/controller-runtime/pkg/log"
@@ -154,7 +154,7 @@ func Test_defaultTargetGroupAttributeReconciler_Reconcile(t *testing.T) {
154154
t.Run(tt.name, func(t *testing.T) {
155155
ctrl := gomock.NewController(t)
156156
defer ctrl.Finish()
157-
elbv2Client := mock_services.NewMockELBV2(ctrl)
157+
elbv2Client := services.NewMockELBV2(ctrl)
158158
for _, call := range tt.fields.describeTargetGroupAttributesWithContextCalls {
159159
elbv2Client.EXPECT().DescribeTargetGroupAttributesWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
160160
}
@@ -310,7 +310,7 @@ func Test_defaultTargetGroupAttributeReconciler_getCurrentTargetGroupAttributes(
310310
t.Run(tt.name, func(t *testing.T) {
311311
ctrl := gomock.NewController(t)
312312
defer ctrl.Finish()
313-
elbv2Client := mock_services.NewMockELBV2(ctrl)
313+
elbv2Client := services.NewMockELBV2(ctrl)
314314
for _, call := range tt.fields.describeTargetGroupAttributesWithContextCalls {
315315
elbv2Client.EXPECT().DescribeTargetGroupAttributesWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
316316
}

pkg/ingress/finalizer_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/stretchr/testify/assert"
88
networking "k8s.io/api/networking/v1beta1"
99
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
10-
mock_k8s "sigs.k8s.io/aws-load-balancer-controller/mocks/k8s"
10+
"sigs.k8s.io/aws-load-balancer-controller/pkg/k8s"
1111
"testing"
1212
)
1313

@@ -190,7 +190,7 @@ func Test_defaultFinalizerManager_AddGroupFinalizer(t *testing.T) {
190190
ctrl := gomock.NewController(t)
191191
defer ctrl.Finish()
192192

193-
k8sFinalizerManager := mock_k8s.NewMockFinalizerManager(ctrl)
193+
k8sFinalizerManager := k8s.NewMockFinalizerManager(ctrl)
194194
for _, call := range tt.fields.addFinalizersCalls {
195195
k8sFinalizerManager.EXPECT().AddFinalizers(gomock.Any(), call.ing, call.finalizer).Return(call.err)
196196
}
@@ -377,7 +377,7 @@ func Test_defaultFinalizerManager_RemoveGroupFinalizer(t *testing.T) {
377377
ctrl := gomock.NewController(t)
378378
defer ctrl.Finish()
379379

380-
k8sFinalizerManager := mock_k8s.NewMockFinalizerManager(ctrl)
380+
k8sFinalizerManager := k8s.NewMockFinalizerManager(ctrl)
381381
for _, call := range tt.fields.removeFinalizersCalls {
382382
k8sFinalizerManager.EXPECT().RemoveFinalizers(gomock.Any(), call.ing, call.finalizer).Return(call.err)
383383
}

pkg/ingress/model_builder_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ import (
1414
"k8s.io/apimachinery/pkg/util/intstr"
1515
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
1616
"k8s.io/client-go/tools/record"
17-
mock_services "sigs.k8s.io/aws-load-balancer-controller/mocks/aws/services"
18-
mock_ingress "sigs.k8s.io/aws-load-balancer-controller/mocks/ingress"
19-
mock_networking "sigs.k8s.io/aws-load-balancer-controller/mocks/networking"
2017
"sigs.k8s.io/aws-load-balancer-controller/pkg/annotations"
18+
"sigs.k8s.io/aws-load-balancer-controller/pkg/aws/services"
2119
"sigs.k8s.io/aws-load-balancer-controller/pkg/deploy"
2220
elbv2model "sigs.k8s.io/aws-load-balancer-controller/pkg/model/elbv2"
21+
networkingpkg "sigs.k8s.io/aws-load-balancer-controller/pkg/networking"
2322
testclient "sigs.k8s.io/controller-runtime/pkg/client/fake"
2423
"sigs.k8s.io/controller-runtime/pkg/log"
2524
"testing"
@@ -1389,13 +1388,13 @@ func Test_defaultModelBuilder_Build(t *testing.T) {
13891388
eventRecorder := record.NewFakeRecorder(10)
13901389
vpcID := "vpc-dummy"
13911390
clusterName := "cluster-dummy"
1392-
ec2Client := mock_services.NewMockEC2(ctrl)
1393-
subnetsResolver := mock_networking.NewMockSubnetsResolver(ctrl)
1391+
ec2Client := services.NewMockEC2(ctrl)
1392+
subnetsResolver := networkingpkg.NewMockSubnetsResolver(ctrl)
13941393
for _, call := range tt.fields.resolveViaDiscoveryCalls {
13951394
subnetsResolver.EXPECT().ResolveViaDiscovery(gomock.Any(), gomock.Any()).Return(call.subnets, call.err)
13961395
}
13971396

1398-
certDiscovery := mock_ingress.NewMockCertDiscovery(ctrl)
1397+
certDiscovery := NewMockCertDiscovery(ctrl)
13991398
annotationParser := annotations.NewSuffixAnnotationParser("alb.ingress.kubernetes.io")
14001399
authConfigBuilder := NewDefaultAuthConfigBuilder(annotationParser)
14011400
enhancedBackendBuilder := NewDefaultEnhancedBackendBuilder(annotationParser)

pkg/networking/az_info_provider_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/golang/mock/gomock"
88
"github.com/pkg/errors"
99
"github.com/stretchr/testify/assert"
10-
mock_services "sigs.k8s.io/aws-load-balancer-controller/mocks/aws/services"
10+
"sigs.k8s.io/aws-load-balancer-controller/pkg/aws/services"
1111
"sigs.k8s.io/controller-runtime/pkg/log"
1212
"testing"
1313
)
@@ -200,7 +200,7 @@ func Test_defaultAZInfoProvider_FetchAZInfos(t *testing.T) {
200200
ctrl := gomock.NewController(t)
201201
defer ctrl.Finish()
202202

203-
ec2Client := mock_services.NewMockEC2(ctrl)
203+
ec2Client := services.NewMockEC2(ctrl)
204204
for _, call := range tt.fields.describeAvailabilityZonesCalls {
205205
ec2Client.EXPECT().DescribeAvailabilityZonesWithContext(gomock.Any(), call.input).Return(call.output, call.err)
206206
}
@@ -329,7 +329,7 @@ func Test_defaultAZInfoProvider_fetchAZInfosFromAWS(t *testing.T) {
329329
ctrl := gomock.NewController(t)
330330
defer ctrl.Finish()
331331

332-
ec2Client := mock_services.NewMockEC2(ctrl)
332+
ec2Client := services.NewMockEC2(ctrl)
333333
for _, call := range tt.fields.describeAvailabilityZonesCalls {
334334
ec2Client.EXPECT().DescribeAvailabilityZonesWithContext(gomock.Any(), call.input).Return(call.output, call.err)
335335
}

pkg/networking/subnet_resolver_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/google/go-cmp/cmp"
1010
"github.com/google/go-cmp/cmp/cmpopts"
1111
"github.com/stretchr/testify/assert"
12-
mock_services "sigs.k8s.io/aws-load-balancer-controller/mocks/aws/services"
12+
"sigs.k8s.io/aws-load-balancer-controller/pkg/aws/services"
1313
elbv2model "sigs.k8s.io/aws-load-balancer-controller/pkg/model/elbv2"
1414
"sigs.k8s.io/controller-runtime/pkg/log"
1515
"testing"
@@ -893,7 +893,7 @@ func Test_defaultSubnetsResolver_ResolveViaDiscovery(t *testing.T) {
893893
ctrl := gomock.NewController(t)
894894
defer ctrl.Finish()
895895

896-
ec2Client := mock_services.NewMockEC2(ctrl)
896+
ec2Client := services.NewMockEC2(ctrl)
897897
for _, call := range tt.fields.describeSubnetsAsListCalls {
898898
ec2Client.EXPECT().DescribeSubnetsAsList(gomock.Any(), call.input).Return(call.output, call.err)
899899
}
@@ -1514,7 +1514,7 @@ func Test_defaultSubnetsResolver_ResolveViaNameOrIDSlice(t *testing.T) {
15141514
ctrl := gomock.NewController(t)
15151515
defer ctrl.Finish()
15161516

1517-
ec2Client := mock_services.NewMockEC2(ctrl)
1517+
ec2Client := services.NewMockEC2(ctrl)
15181518
for _, call := range tt.fields.describeSubnetsAsListCalls {
15191519
ec2Client.EXPECT().DescribeSubnetsAsList(gomock.Any(), call.input).Return(call.output, call.err)
15201520
}

pkg/service/model_build_load_balancer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package service
33
import (
44
"context"
55
"errors"
6+
"sigs.k8s.io/aws-load-balancer-controller/pkg/networking"
67
"testing"
78

89
"github.com/aws/aws-sdk-go/aws"
@@ -11,7 +12,6 @@ import (
1112
"github.com/stretchr/testify/assert"
1213
corev1 "k8s.io/api/core/v1"
1314
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
14-
mock_networking "sigs.k8s.io/aws-load-balancer-controller/mocks/networking"
1515
"sigs.k8s.io/aws-load-balancer-controller/pkg/annotations"
1616
"sigs.k8s.io/aws-load-balancer-controller/pkg/model/elbv2"
1717
)
@@ -526,7 +526,7 @@ func Test_defaultModelBuilderTask_resolveLoadBalancerSubnets(t *testing.T) {
526526
ctrl := gomock.NewController(t)
527527
defer ctrl.Finish()
528528

529-
subnetsResolver := mock_networking.NewMockSubnetsResolver(ctrl)
529+
subnetsResolver := networking.NewMockSubnetsResolver(ctrl)
530530
for _, call := range tt.resolveViaDiscovery {
531531
subnetsResolver.EXPECT().ResolveViaDiscovery(gomock.Any(), gomock.Any()).Return(call.subnets, call.err)
532532
}

pkg/service/model_builder_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package service
22

33
import (
44
"context"
5+
"sigs.k8s.io/aws-load-balancer-controller/pkg/networking"
56
"testing"
67
"time"
78

@@ -12,7 +13,6 @@ import (
1213
corev1 "k8s.io/api/core/v1"
1314
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1415
"k8s.io/apimachinery/pkg/util/intstr"
15-
mock_networking "sigs.k8s.io/aws-load-balancer-controller/mocks/networking"
1616
"sigs.k8s.io/aws-load-balancer-controller/pkg/annotations"
1717
"sigs.k8s.io/aws-load-balancer-controller/pkg/deploy"
1818
)
@@ -1677,7 +1677,7 @@ func Test_defaultModelBuilderTask_Build(t *testing.T) {
16771677
ctrl := gomock.NewController(t)
16781678
defer ctrl.Finish()
16791679

1680-
subnetsResolver := mock_networking.NewMockSubnetsResolver(ctrl)
1680+
subnetsResolver := networking.NewMockSubnetsResolver(ctrl)
16811681
for _, call := range tt.resolveViaDiscoveryCalls {
16821682
subnetsResolver.EXPECT().ResolveViaDiscovery(gomock.Any(), gomock.Any()).Return(call.subnets, call.err)
16831683
}

pkg/targetgroupbinding/targets_manager_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/golang/mock/gomock"
88
"github.com/stretchr/testify/assert"
99
"k8s.io/apimachinery/pkg/util/cache"
10-
mock_services "sigs.k8s.io/aws-load-balancer-controller/mocks/aws/services"
10+
"sigs.k8s.io/aws-load-balancer-controller/pkg/aws/services"
1111
"sigs.k8s.io/controller-runtime/pkg/log"
1212
"sync"
1313
"testing"
@@ -260,7 +260,7 @@ func Test_cachedTargetsManager_RegisterTargets(t *testing.T) {
260260
t.Run(tt.name, func(t *testing.T) {
261261
ctrl := gomock.NewController(t)
262262
defer ctrl.Finish()
263-
elbv2Client := mock_services.NewMockELBV2(ctrl)
263+
elbv2Client := services.NewMockELBV2(ctrl)
264264
for _, call := range tt.fields.registerTargetsWithContextCalls {
265265
elbv2Client.EXPECT().RegisterTargetsWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
266266
}
@@ -505,7 +505,7 @@ func Test_cachedTargetsManager_DeregisterTargets(t *testing.T) {
505505
t.Run(tt.name, func(t *testing.T) {
506506
ctrl := gomock.NewController(t)
507507
defer ctrl.Finish()
508-
elbv2Client := mock_services.NewMockELBV2(ctrl)
508+
elbv2Client := services.NewMockELBV2(ctrl)
509509
for _, call := range tt.fields.deregisterTargetsWithContextCalls {
510510
elbv2Client.EXPECT().DeregisterTargetsWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
511511
}
@@ -770,7 +770,7 @@ func Test_cachedTargetsManager_ListTargets(t *testing.T) {
770770
ctrl := gomock.NewController(t)
771771
defer ctrl.Finish()
772772

773-
elbv2Client := mock_services.NewMockELBV2(ctrl)
773+
elbv2Client := services.NewMockELBV2(ctrl)
774774
for _, call := range tt.fields.describeTargetHealthWithContextCalls {
775775
elbv2Client.EXPECT().DescribeTargetHealthWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
776776
}
@@ -1180,7 +1180,7 @@ func Test_cachedTargetsManager_refreshUnhealthyTargets(t *testing.T) {
11801180
ctrl := gomock.NewController(t)
11811181
defer ctrl.Finish()
11821182

1183-
elbv2Client := mock_services.NewMockELBV2(ctrl)
1183+
elbv2Client := services.NewMockELBV2(ctrl)
11841184
for _, call := range tt.fields.describeTargetHealthWithContextCalls {
11851185
elbv2Client.EXPECT().DescribeTargetHealthWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
11861186
}
@@ -1342,7 +1342,7 @@ func Test_cachedTargetsManager_listTargetsFromAWS(t *testing.T) {
13421342
ctrl := gomock.NewController(t)
13431343
defer ctrl.Finish()
13441344

1345-
elbv2Client := mock_services.NewMockELBV2(ctrl)
1345+
elbv2Client := services.NewMockELBV2(ctrl)
13461346
for _, call := range tt.fields.describeTargetHealthWithContextCalls {
13471347
elbv2Client.EXPECT().DescribeTargetHealthWithContext(gomock.Any(), call.req).Return(call.resp, call.err)
13481348
}

pkg/webhook/mutating_handler_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"k8s.io/apimachinery/pkg/runtime"
1414
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
1515
"net/http"
16-
mock_webhook "sigs.k8s.io/aws-load-balancer-controller/mocks/webhook"
1716
"sigs.k8s.io/aws-load-balancer-controller/pkg/algorithm"
1817
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
1918
"testing"
@@ -383,7 +382,7 @@ func Test_mutatingHandler_Handle(t *testing.T) {
383382
ctx := context.Background()
384383
ctrl := gomock.NewController(t)
385384
defer ctrl.Finish()
386-
mutator := mock_webhook.NewMockMutator(ctrl)
385+
mutator := NewMockMutator(ctrl)
387386
if tt.fields.mutatorPrototype != nil {
388387
mutator.EXPECT().Prototype(gomock.Any()).DoAndReturn(tt.fields.mutatorPrototype)
389388
}

pkg/webhook/validating_handler_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"k8s.io/apimachinery/pkg/runtime"
1313
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
1414
"net/http"
15-
mock_webhook "sigs.k8s.io/aws-load-balancer-controller/mocks/webhook"
1615
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
1716
"testing"
1817
)
@@ -389,7 +388,7 @@ func Test_validatingHandler_Handle(t *testing.T) {
389388
ctx := context.Background()
390389
ctrl := gomock.NewController(t)
391390
defer ctrl.Finish()
392-
validator := mock_webhook.NewMockValidator(ctrl)
391+
validator := NewMockValidator(ctrl)
393392
if tt.fields.validatorPrototype != nil {
394393
validator.EXPECT().Prototype(gomock.Any()).DoAndReturn(tt.fields.validatorPrototype)
395394
}

0 commit comments

Comments
 (0)