From 63f1a70c1ae18607f3863ab6a9cf1b4dafa53f48 Mon Sep 17 00:00:00 2001 From: Mattia Lavacca Date: Mon, 21 Oct 2024 10:54:09 +0200 Subject: [PATCH] chore: move mock under sdk Signed-off-by: Mattia Lavacca --- .../konnect/ops/ops_controlplane_test.go | 86 +++++++++---------- .../konnect/ops/ops_kongservice_test.go | 48 +++++------ .../konnect/ops/ops_kongupstream_test.go | 44 +++++----- controller/konnect/ops/ops_kongvault_test.go | 44 +++++----- .../ops/{ => sdk}/mock/sdkfactory_mock.go | 0 .../mock/zz_generated.controlplane_mock.go | 0 .../zz_generated.controlplanegroup_mock.go | 0 .../mock/zz_generated.credentialacl_mock.go | 0 .../zz_generated.credentialapikey_mock.go | 0 .../zz_generated.credentialbasicauth_mock.go | 0 .../mock/zz_generated.credentialhmac_mock.go | 0 .../mock/zz_generated.credentialjwt_mock.go | 0 .../zz_generated.kongcacertificate_mock.go | 0 .../mock/zz_generated.kongcertificate_mock.go | 0 .../mock/zz_generated.kongconsumer_mock.go | 0 .../zz_generated.kongconsumergroup_mock.go | 0 ...generated.kongdataplanecertificate_mock.go | 0 .../mock/zz_generated.kongkey_mock.go | 0 .../mock/zz_generated.kongkeyset_mock.go | 0 .../mock/zz_generated.kongroute_mock.go | 0 .../mock/zz_generated.kongservice_mock.go | 0 .../mock/zz_generated.kongsni_mock.go | 0 .../mock/zz_generated.kongtarget_mock.go | 0 .../mock/zz_generated.kongupstream_mock.go | 0 .../mock/zz_generated.kongvault_mock.go | 0 .../{ => sdk}/mock/zz_generated.me_mock.go | 0 .../mock/zz_generated.plugin_mock.go | 0 .../kongconsumercredential_acl_test.go | 4 +- .../kongconsumercredential_apikey_test.go | 4 +- .../kongconsumercredential_basicauth_test.go | 4 +- .../kongconsumercredential_hmac_test.go | 4 +- .../kongconsumercredential_jwt_test.go | 4 +- .../envtest/kongpluginbinding_managed_test.go | 4 +- .../kongpluginbinding_unmanaged_test.go | 4 +- ...nnect_entities_gatewaycontrolplane_test.go | 10 +-- ...konnect_entities_kongcacertificate_test.go | 4 +- .../konnect_entities_kongcertificate_test.go | 4 +- .../konnect_entities_kongconsumer_test.go | 4 +- ...konnect_entities_kongconsumergroup_test.go | 4 +- ...ies_kongdataplaneclientcertificate_test.go | 4 +- test/envtest/konnect_entities_kongkey_test.go | 4 +- .../konnect_entities_kongkeyset_test.go | 4 +- .../konnect_entities_kongroute_test.go | 4 +- .../konnect_entities_kongservice_test.go | 4 +- test/envtest/konnect_entities_kongsni_test.go | 4 +- .../konnect_entities_kongtarget_test.go | 4 +- .../konnect_entities_kongupstream_test.go | 4 +- .../konnect_entities_kongvault_test.go | 4 +- test/envtest/konnect_entities_suite_test.go | 6 +- 49 files changed, 159 insertions(+), 159 deletions(-) rename controller/konnect/ops/{ => sdk}/mock/sdkfactory_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.controlplane_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.controlplanegroup_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.credentialacl_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.credentialapikey_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.credentialbasicauth_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.credentialhmac_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.credentialjwt_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongcacertificate_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongcertificate_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongconsumer_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongconsumergroup_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongdataplanecertificate_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongkey_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongkeyset_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongroute_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongservice_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongsni_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongtarget_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongupstream_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.kongvault_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.me_mock.go (100%) rename controller/konnect/ops/{ => sdk}/mock/zz_generated.plugin_mock.go (100%) diff --git a/controller/konnect/ops/ops_controlplane_test.go b/controller/konnect/ops/ops_controlplane_test.go index b0234c38a..c8c8595bb 100644 --- a/controller/konnect/ops/ops_controlplane_test.go +++ b/controller/konnect/ops/ops_controlplane_test.go @@ -20,7 +20,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1" @@ -34,7 +34,7 @@ func TestCreateControlPlane(t *testing.T) { ctx := context.Background() testCases := []struct { name string - mockCPTuple func(*testing.T) (*mockops.MockControlPlaneSDK, *mockops.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) + mockCPTuple func(*testing.T) (*sdkmock.MockControlPlaneSDK, *sdkmock.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) objects []client.Object expectedErrContains string expectedErrType error @@ -42,9 +42,9 @@ func TestCreateControlPlane(t *testing.T) { }{ { name: "success", - mockCPTuple: func(t *testing.T) (*mockops.MockControlPlaneSDK, *mockops.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { - sdk := mockops.NewMockControlPlaneSDK(t) - sdkGroups := mockops.NewMockControlPlaneGroupSDK(t) + mockCPTuple: func(t *testing.T) (*sdkmock.MockControlPlaneSDK, *sdkmock.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { + sdk := sdkmock.NewMockControlPlaneSDK(t) + sdkGroups := sdkmock.NewMockControlPlaneGroupSDK(t) cp := &konnectv1alpha1.KonnectGatewayControlPlane{ Spec: konnectv1alpha1.KonnectGatewayControlPlaneSpec{ CreateControlPlaneRequest: sdkkonnectcomp.CreateControlPlaneRequest{ @@ -73,9 +73,9 @@ func TestCreateControlPlane(t *testing.T) { }, { name: "fail", - mockCPTuple: func(t *testing.T) (*mockops.MockControlPlaneSDK, *mockops.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { - sdk := mockops.NewMockControlPlaneSDK(t) - sdkGroups := mockops.NewMockControlPlaneGroupSDK(t) + mockCPTuple: func(t *testing.T) (*sdkmock.MockControlPlaneSDK, *sdkmock.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { + sdk := sdkmock.NewMockControlPlaneSDK(t) + sdkGroups := sdkmock.NewMockControlPlaneGroupSDK(t) cp := &konnectv1alpha1.KonnectGatewayControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cp-1", @@ -126,9 +126,9 @@ func TestCreateControlPlane(t *testing.T) { }, }, }, - mockCPTuple: func(t *testing.T) (*mockops.MockControlPlaneSDK, *mockops.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { - sdk := mockops.NewMockControlPlaneSDK(t) - sdkGroups := mockops.NewMockControlPlaneGroupSDK(t) + mockCPTuple: func(t *testing.T) (*sdkmock.MockControlPlaneSDK, *sdkmock.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { + sdk := sdkmock.NewMockControlPlaneSDK(t) + sdkGroups := sdkmock.NewMockControlPlaneGroupSDK(t) cp := &konnectv1alpha1.KonnectGatewayControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cpg-1", @@ -195,9 +195,9 @@ func TestCreateControlPlane(t *testing.T) { }, }, }, - mockCPTuple: func(t *testing.T) (*mockops.MockControlPlaneSDK, *mockops.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { - sdk := mockops.NewMockControlPlaneSDK(t) - sdkGroups := mockops.NewMockControlPlaneGroupSDK(t) + mockCPTuple: func(t *testing.T) (*sdkmock.MockControlPlaneSDK, *sdkmock.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { + sdk := sdkmock.NewMockControlPlaneSDK(t) + sdkGroups := sdkmock.NewMockControlPlaneGroupSDK(t) cp := &konnectv1alpha1.KonnectGatewayControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cpg-1", @@ -276,14 +276,14 @@ func TestDeleteControlPlane(t *testing.T) { ctx := context.Background() testCases := []struct { name string - mockCPPair func(*testing.T) (*mockops.MockControlPlaneSDK, *konnectv1alpha1.KonnectGatewayControlPlane) + mockCPPair func(*testing.T) (*sdkmock.MockControlPlaneSDK, *konnectv1alpha1.KonnectGatewayControlPlane) expectedErr bool assertions func(*testing.T, *konnectv1alpha1.KonnectGatewayControlPlane) }{ { name: "success", - mockCPPair: func(t *testing.T) (*mockops.MockControlPlaneSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { - sdk := mockops.NewMockControlPlaneSDK(t) + mockCPPair: func(t *testing.T) (*sdkmock.MockControlPlaneSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { + sdk := sdkmock.NewMockControlPlaneSDK(t) cp := &konnectv1alpha1.KonnectGatewayControlPlane{ Spec: konnectv1alpha1.KonnectGatewayControlPlaneSpec{ CreateControlPlaneRequest: sdkkonnectcomp.CreateControlPlaneRequest{ @@ -311,8 +311,8 @@ func TestDeleteControlPlane(t *testing.T) { }, { name: "fail", - mockCPPair: func(t *testing.T) (*mockops.MockControlPlaneSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { - sdk := mockops.NewMockControlPlaneSDK(t) + mockCPPair: func(t *testing.T) (*sdkmock.MockControlPlaneSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { + sdk := sdkmock.NewMockControlPlaneSDK(t) cp := &konnectv1alpha1.KonnectGatewayControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cp-1", @@ -346,8 +346,8 @@ func TestDeleteControlPlane(t *testing.T) { }, { name: "not found error is ignored and considered a success when trying to delete", - mockCPPair: func(t *testing.T) (*mockops.MockControlPlaneSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { - sdk := mockops.NewMockControlPlaneSDK(t) + mockCPPair: func(t *testing.T) (*sdkmock.MockControlPlaneSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { + sdk := sdkmock.NewMockControlPlaneSDK(t) cp := &konnectv1alpha1.KonnectGatewayControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cp-1", @@ -404,15 +404,15 @@ func TestUpdateControlPlane(t *testing.T) { ctx := context.Background() testCases := []struct { name string - mockCPTuple func(*testing.T) (*mockops.MockControlPlaneSDK, *mockops.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) + mockCPTuple func(*testing.T) (*sdkmock.MockControlPlaneSDK, *sdkmock.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) expectedErr bool expectedID string }{ { name: "success", - mockCPTuple: func(t *testing.T) (*mockops.MockControlPlaneSDK, *mockops.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { - sdk := mockops.NewMockControlPlaneSDK(t) - sdkGroups := mockops.NewMockControlPlaneGroupSDK(t) + mockCPTuple: func(t *testing.T) (*sdkmock.MockControlPlaneSDK, *sdkmock.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { + sdk := sdkmock.NewMockControlPlaneSDK(t) + sdkGroups := sdkmock.NewMockControlPlaneGroupSDK(t) cp := &konnectv1alpha1.KonnectGatewayControlPlane{ Spec: konnectv1alpha1.KonnectGatewayControlPlaneSpec{ CreateControlPlaneRequest: sdkkonnectcomp.CreateControlPlaneRequest{ @@ -451,9 +451,9 @@ func TestUpdateControlPlane(t *testing.T) { }, { name: "fail", - mockCPTuple: func(t *testing.T) (*mockops.MockControlPlaneSDK, *mockops.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { - sdk := mockops.NewMockControlPlaneSDK(t) - sdkGroups := mockops.NewMockControlPlaneGroupSDK(t) + mockCPTuple: func(t *testing.T) (*sdkmock.MockControlPlaneSDK, *sdkmock.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { + sdk := sdkmock.NewMockControlPlaneSDK(t) + sdkGroups := sdkmock.NewMockControlPlaneGroupSDK(t) cp := &konnectv1alpha1.KonnectGatewayControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cp-1", @@ -496,9 +496,9 @@ func TestUpdateControlPlane(t *testing.T) { }, { name: "when not found then try to create", - mockCPTuple: func(t *testing.T) (*mockops.MockControlPlaneSDK, *mockops.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { - sdk := mockops.NewMockControlPlaneSDK(t) - sdkGroups := mockops.NewMockControlPlaneGroupSDK(t) + mockCPTuple: func(t *testing.T) (*sdkmock.MockControlPlaneSDK, *sdkmock.MockControlPlaneGroupSDK, *konnectv1alpha1.KonnectGatewayControlPlane) { + sdk := sdkmock.NewMockControlPlaneSDK(t) + sdkGroups := sdkmock.NewMockControlPlaneGroupSDK(t) cp := &konnectv1alpha1.KonnectGatewayControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cp-1", @@ -593,7 +593,7 @@ func TestCreateAndUpdateControlPlane_KubernetesMetadataConsistency(t *testing.T) }, }, } - sdk = mockops.NewMockSDKFactory(t) + sdk = sdkmock.NewMockSDKFactory(t) sdkControlPlanes = sdk.SDK.ControlPlaneSDK fakeClient = fake.NewClientBuilder().Build() ) @@ -641,7 +641,7 @@ func TestSetGroupMembers(t *testing.T) { name string group *konnectv1alpha1.KonnectGatewayControlPlane cps []client.Object - sdk func(t *testing.T) *mockops.MockControlPlaneGroupSDK + sdk func(t *testing.T) *sdkmock.MockControlPlaneGroupSDK expectedErr bool }{ { @@ -658,8 +658,8 @@ func TestSetGroupMembers(t *testing.T) { }, }, }, - sdk: func(t *testing.T) *mockops.MockControlPlaneGroupSDK { - sdk := mockops.NewMockControlPlaneGroupSDK(t) + sdk: func(t *testing.T) *sdkmock.MockControlPlaneGroupSDK { + sdk := sdkmock.NewMockControlPlaneGroupSDK(t) return sdk }, }, @@ -695,8 +695,8 @@ func TestSetGroupMembers(t *testing.T) { }, }, }, - sdk: func(t *testing.T) *mockops.MockControlPlaneGroupSDK { - sdk := mockops.NewMockControlPlaneGroupSDK(t) + sdk: func(t *testing.T) *sdkmock.MockControlPlaneGroupSDK { + sdk := sdkmock.NewMockControlPlaneGroupSDK(t) sdk.EXPECT(). PutControlPlanesIDGroupMemberships( mock.Anything, @@ -744,8 +744,8 @@ func TestSetGroupMembers(t *testing.T) { Status: konnectv1alpha1.KonnectGatewayControlPlaneStatus{}, }, }, - sdk: func(t *testing.T) *mockops.MockControlPlaneGroupSDK { - sdk := mockops.NewMockControlPlaneGroupSDK(t) + sdk: func(t *testing.T) *sdkmock.MockControlPlaneGroupSDK { + sdk := sdkmock.NewMockControlPlaneGroupSDK(t) return sdk }, expectedErr: true, @@ -796,8 +796,8 @@ func TestSetGroupMembers(t *testing.T) { }, }, }, - sdk: func(t *testing.T) *mockops.MockControlPlaneGroupSDK { - sdk := mockops.NewMockControlPlaneGroupSDK(t) + sdk: func(t *testing.T) *sdkmock.MockControlPlaneGroupSDK { + sdk := sdkmock.NewMockControlPlaneGroupSDK(t) sdk.EXPECT(). PutControlPlanesIDGroupMemberships( mock.Anything, @@ -861,8 +861,8 @@ func TestSetGroupMembers(t *testing.T) { }, }, }, - sdk: func(t *testing.T) *mockops.MockControlPlaneGroupSDK { - sdk := mockops.NewMockControlPlaneGroupSDK(t) + sdk: func(t *testing.T) *sdkmock.MockControlPlaneGroupSDK { + sdk := sdkmock.NewMockControlPlaneGroupSDK(t) return sdk }, expectedErr: true, diff --git a/controller/konnect/ops/ops_kongservice_test.go b/controller/konnect/ops/ops_kongservice_test.go index 50c73b625..8ac5312b2 100644 --- a/controller/konnect/ops/ops_kongservice_test.go +++ b/controller/konnect/ops/ops_kongservice_test.go @@ -15,7 +15,7 @@ import ( k8stypes "k8s.io/apimachinery/pkg/types" konnectconsts "github.com/kong/gateway-operator/controller/konnect/consts" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" configurationv1alpha1 "github.com/kong/kubernetes-configuration/api/configuration/v1alpha1" konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1" @@ -25,15 +25,15 @@ func TestCreateKongService(t *testing.T) { ctx := context.Background() testCases := []struct { name string - mockServicePair func(*testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) + mockServicePair func(*testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) assertions func(*testing.T, *configurationv1alpha1.KongService) expectedErrContains string expectedErrType error }{ { name: "success", - mockServicePair: func(t *testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) { - sdk := mockops.NewMockServicesSDK(t) + mockServicePair: func(t *testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) { + sdk := sdkmock.NewMockServicesSDK(t) svc := &configurationv1alpha1.KongService{ ObjectMeta: metav1.ObjectMeta{ Name: "svc-1", @@ -74,8 +74,8 @@ func TestCreateKongService(t *testing.T) { }, { name: "fail - no control plane ID in status returns an error and does not create the Service in Konnect", - mockServicePair: func(t *testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) { - sdk := mockops.NewMockServicesSDK(t) + mockServicePair: func(t *testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) { + sdk := sdkmock.NewMockServicesSDK(t) svc := &configurationv1alpha1.KongService{ ObjectMeta: metav1.ObjectMeta{ Name: "svc-1", @@ -98,8 +98,8 @@ func TestCreateKongService(t *testing.T) { }, { name: "fail", - mockServicePair: func(t *testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) { - sdk := mockops.NewMockServicesSDK(t) + mockServicePair: func(t *testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) { + sdk := sdkmock.NewMockServicesSDK(t) svc := &configurationv1alpha1.KongService{ ObjectMeta: metav1.ObjectMeta{ Name: "svc-1", @@ -138,8 +138,8 @@ func TestCreateKongService(t *testing.T) { }, { name: "409 Conflict causes a list to find a matching (by UID) service and update it instead of creating a new one", - mockServicePair: func(t *testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) { - sdk := mockops.NewMockServicesSDK(t) + mockServicePair: func(t *testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) { + sdk := sdkmock.NewMockServicesSDK(t) svc := &configurationv1alpha1.KongService{ ObjectMeta: metav1.ObjectMeta{ Name: "svc-1", @@ -203,14 +203,14 @@ func TestDeleteKongService(t *testing.T) { ctx := context.Background() testCases := []struct { name string - mockServicePair func(*testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) + mockServicePair func(*testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) expectedErr bool assertions func(*testing.T, *configurationv1alpha1.KongService) }{ { name: "success", - mockServicePair: func(t *testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) { - sdk := mockops.NewMockServicesSDK(t) + mockServicePair: func(t *testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) { + sdk := sdkmock.NewMockServicesSDK(t) svc := &configurationv1alpha1.KongService{ Spec: configurationv1alpha1.KongServiceSpec{ KongServiceAPISpec: configurationv1alpha1.KongServiceAPISpec{ @@ -241,8 +241,8 @@ func TestDeleteKongService(t *testing.T) { }, { name: "fail", - mockServicePair: func(t *testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) { - sdk := mockops.NewMockServicesSDK(t) + mockServicePair: func(t *testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) { + sdk := sdkmock.NewMockServicesSDK(t) svc := &configurationv1alpha1.KongService{ Spec: configurationv1alpha1.KongServiceSpec{ KongServiceAPISpec: configurationv1alpha1.KongServiceAPISpec{ @@ -275,8 +275,8 @@ func TestDeleteKongService(t *testing.T) { }, { name: "not found error is ignored and considered a success when trying to delete", - mockServicePair: func(t *testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) { - sdk := mockops.NewMockServicesSDK(t) + mockServicePair: func(t *testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) { + sdk := sdkmock.NewMockServicesSDK(t) svc := &configurationv1alpha1.KongService{ Spec: configurationv1alpha1.KongServiceSpec{ KongServiceAPISpec: configurationv1alpha1.KongServiceAPISpec{ @@ -332,14 +332,14 @@ func TestUpdateKongService(t *testing.T) { ctx := context.Background() testCases := []struct { name string - mockServicePair func(*testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) + mockServicePair func(*testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) expectedErr bool assertions func(*testing.T, *configurationv1alpha1.KongService) }{ { name: "success", - mockServicePair: func(t *testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) { - sdk := mockops.NewMockServicesSDK(t) + mockServicePair: func(t *testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) { + sdk := sdkmock.NewMockServicesSDK(t) svc := &configurationv1alpha1.KongService{ Spec: configurationv1alpha1.KongServiceSpec{ KongServiceAPISpec: configurationv1alpha1.KongServiceAPISpec{ @@ -383,8 +383,8 @@ func TestUpdateKongService(t *testing.T) { }, { name: "fail", - mockServicePair: func(t *testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) { - sdk := mockops.NewMockServicesSDK(t) + mockServicePair: func(t *testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) { + sdk := sdkmock.NewMockServicesSDK(t) svc := &configurationv1alpha1.KongService{ ObjectMeta: metav1.ObjectMeta{ Name: "svc-1", @@ -430,8 +430,8 @@ func TestUpdateKongService(t *testing.T) { }, { name: "when not found then try to create", - mockServicePair: func(t *testing.T) (*mockops.MockServicesSDK, *configurationv1alpha1.KongService) { - sdk := mockops.NewMockServicesSDK(t) + mockServicePair: func(t *testing.T) (*sdkmock.MockServicesSDK, *configurationv1alpha1.KongService) { + sdk := sdkmock.NewMockServicesSDK(t) svc := &configurationv1alpha1.KongService{ ObjectMeta: metav1.ObjectMeta{ Name: "svc-1", diff --git a/controller/konnect/ops/ops_kongupstream_test.go b/controller/konnect/ops/ops_kongupstream_test.go index 69395391e..6facf6bab 100644 --- a/controller/konnect/ops/ops_kongupstream_test.go +++ b/controller/konnect/ops/ops_kongupstream_test.go @@ -15,7 +15,7 @@ import ( k8stypes "k8s.io/apimachinery/pkg/types" konnectconsts "github.com/kong/gateway-operator/controller/konnect/consts" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" configurationv1alpha1 "github.com/kong/kubernetes-configuration/api/configuration/v1alpha1" konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1" @@ -25,14 +25,14 @@ func TestCreateKongUpstream(t *testing.T) { ctx := context.Background() testCases := []struct { name string - mockUpstreamPair func(*testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) + mockUpstreamPair func(*testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) expectedErr bool assertions func(*testing.T, *configurationv1alpha1.KongUpstream) }{ { name: "success", - mockUpstreamPair: func(t *testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { - sdk := mockops.NewMockUpstreamsSDK(t) + mockUpstreamPair: func(t *testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { + sdk := sdkmock.NewMockUpstreamsSDK(t) svc := &configurationv1alpha1.KongUpstream{ ObjectMeta: metav1.ObjectMeta{ Name: "svc-1", @@ -71,8 +71,8 @@ func TestCreateKongUpstream(t *testing.T) { }, { name: "fail - no control plane ID in status returns an error and does not create the Upstream in Konnect", - mockUpstreamPair: func(t *testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { - sdk := mockops.NewMockUpstreamsSDK(t) + mockUpstreamPair: func(t *testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { + sdk := sdkmock.NewMockUpstreamsSDK(t) svc := &configurationv1alpha1.KongUpstream{ ObjectMeta: metav1.ObjectMeta{ Name: "svc-1", @@ -95,8 +95,8 @@ func TestCreateKongUpstream(t *testing.T) { }, { name: "fail", - mockUpstreamPair: func(t *testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { - sdk := mockops.NewMockUpstreamsSDK(t) + mockUpstreamPair: func(t *testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { + sdk := sdkmock.NewMockUpstreamsSDK(t) svc := &configurationv1alpha1.KongUpstream{ ObjectMeta: metav1.ObjectMeta{ Name: "svc-1", @@ -156,14 +156,14 @@ func TestDeleteKongUpstream(t *testing.T) { ctx := context.Background() testCases := []struct { name string - mockUpstreamPair func(*testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) + mockUpstreamPair func(*testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) expectedErr bool assertions func(*testing.T, *configurationv1alpha1.KongUpstream) }{ { name: "success", - mockUpstreamPair: func(t *testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { - sdk := mockops.NewMockUpstreamsSDK(t) + mockUpstreamPair: func(t *testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { + sdk := sdkmock.NewMockUpstreamsSDK(t) svc := &configurationv1alpha1.KongUpstream{ Spec: configurationv1alpha1.KongUpstreamSpec{ KongUpstreamAPISpec: configurationv1alpha1.KongUpstreamAPISpec{ @@ -194,8 +194,8 @@ func TestDeleteKongUpstream(t *testing.T) { }, { name: "fail", - mockUpstreamPair: func(t *testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { - sdk := mockops.NewMockUpstreamsSDK(t) + mockUpstreamPair: func(t *testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { + sdk := sdkmock.NewMockUpstreamsSDK(t) svc := &configurationv1alpha1.KongUpstream{ Spec: configurationv1alpha1.KongUpstreamSpec{ KongUpstreamAPISpec: configurationv1alpha1.KongUpstreamAPISpec{ @@ -228,8 +228,8 @@ func TestDeleteKongUpstream(t *testing.T) { }, { name: "not found error is ignored and considered a success when trying to delete", - mockUpstreamPair: func(t *testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { - sdk := mockops.NewMockUpstreamsSDK(t) + mockUpstreamPair: func(t *testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { + sdk := sdkmock.NewMockUpstreamsSDK(t) svc := &configurationv1alpha1.KongUpstream{ Spec: configurationv1alpha1.KongUpstreamSpec{ KongUpstreamAPISpec: configurationv1alpha1.KongUpstreamAPISpec{ @@ -285,14 +285,14 @@ func TestUpdateKongUpstream(t *testing.T) { ctx := context.Background() testCases := []struct { name string - mockUpstreamPair func(*testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) + mockUpstreamPair func(*testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) expectedErr bool assertions func(*testing.T, *configurationv1alpha1.KongUpstream) }{ { name: "success", - mockUpstreamPair: func(t *testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { - sdk := mockops.NewMockUpstreamsSDK(t) + mockUpstreamPair: func(t *testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { + sdk := sdkmock.NewMockUpstreamsSDK(t) svc := &configurationv1alpha1.KongUpstream{ Spec: configurationv1alpha1.KongUpstreamSpec{ KongUpstreamAPISpec: configurationv1alpha1.KongUpstreamAPISpec{ @@ -336,8 +336,8 @@ func TestUpdateKongUpstream(t *testing.T) { }, { name: "fail", - mockUpstreamPair: func(t *testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { - sdk := mockops.NewMockUpstreamsSDK(t) + mockUpstreamPair: func(t *testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { + sdk := sdkmock.NewMockUpstreamsSDK(t) svc := &configurationv1alpha1.KongUpstream{ ObjectMeta: metav1.ObjectMeta{ Name: "svc-1", @@ -385,8 +385,8 @@ func TestUpdateKongUpstream(t *testing.T) { }, { name: "when not found then try to create", - mockUpstreamPair: func(t *testing.T) (*mockops.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { - sdk := mockops.NewMockUpstreamsSDK(t) + mockUpstreamPair: func(t *testing.T) (*sdkmock.MockUpstreamsSDK, *configurationv1alpha1.KongUpstream) { + sdk := sdkmock.NewMockUpstreamsSDK(t) svc := &configurationv1alpha1.KongUpstream{ ObjectMeta: metav1.ObjectMeta{ Name: "svc-1", diff --git a/controller/konnect/ops/ops_kongvault_test.go b/controller/konnect/ops/ops_kongvault_test.go index 3ba354c08..adae81e07 100644 --- a/controller/konnect/ops/ops_kongvault_test.go +++ b/controller/konnect/ops/ops_kongvault_test.go @@ -15,7 +15,7 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes" configurationv1alpha1 "github.com/kong/kubernetes-configuration/api/configuration/v1alpha1" @@ -32,14 +32,14 @@ func mustConvertKongVaultToVaultInput(t *testing.T, vault *configurationv1alpha1 func TestCreateKongVault(t *testing.T) { testCases := []struct { name string - mockVaultPair func(*testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) + mockVaultPair func(*testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) expectedErr bool assertions func(*testing.T, *configurationv1alpha1.KongVault) }{ { name: "success", - mockVaultPair: func(t *testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) { - sdk := mockops.NewMockVaultSDK(t) + mockVaultPair: func(t *testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) { + sdk := sdkmock.NewMockVaultSDK(t) vault := &configurationv1alpha1.KongVault{ ObjectMeta: metav1.ObjectMeta{ Name: "vault-1", @@ -81,7 +81,7 @@ func TestCreateKongVault(t *testing.T) { }, { name: "failed - no control plane ID in Konnect status", - mockVaultPair: func(t *testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) { + mockVaultPair: func(t *testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) { vault := &configurationv1alpha1.KongVault{ ObjectMeta: metav1.ObjectMeta{ Name: "vault-no-cpid", @@ -95,7 +95,7 @@ func TestCreateKongVault(t *testing.T) { }, Status: configurationv1alpha1.KongVaultStatus{}, } - return mockops.NewMockVaultSDK(t), vault + return sdkmock.NewMockVaultSDK(t), vault }, expectedErr: true, assertions: func(t *testing.T, vault *configurationv1alpha1.KongVault) { @@ -104,8 +104,8 @@ func TestCreateKongVault(t *testing.T) { }, { name: "fail - upstream returns non-OK response", - mockVaultPair: func(t *testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) { - sdk := mockops.NewMockVaultSDK(t) + mockVaultPair: func(t *testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) { + sdk := sdkmock.NewMockVaultSDK(t) vault := &configurationv1alpha1.KongVault{ ObjectMeta: metav1.ObjectMeta{ Name: "vault-1", @@ -165,14 +165,14 @@ func TestCreateKongVault(t *testing.T) { func TestUpdateKongVault(t *testing.T) { testCases := []struct { name string - mockVaultPair func(*testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) + mockVaultPair func(*testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) expectedErr bool assertions func(*testing.T, *configurationv1alpha1.KongVault) }{ { name: "success", - mockVaultPair: func(t *testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) { - sdk := mockops.NewMockVaultSDK(t) + mockVaultPair: func(t *testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) { + sdk := sdkmock.NewMockVaultSDK(t) vault := &configurationv1alpha1.KongVault{ ObjectMeta: metav1.ObjectMeta{ Name: "vault-1", @@ -223,8 +223,8 @@ func TestUpdateKongVault(t *testing.T) { }, { name: "fail - upstream returns non-OK response", - mockVaultPair: func(t *testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) { - sdk := mockops.NewMockVaultSDK(t) + mockVaultPair: func(t *testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) { + sdk := sdkmock.NewMockVaultSDK(t) vault := &configurationv1alpha1.KongVault{ ObjectMeta: metav1.ObjectMeta{ Name: "vault-1", @@ -268,8 +268,8 @@ func TestUpdateKongVault(t *testing.T) { }, { name: "try to create when not found", - mockVaultPair: func(t *testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) { - sdk := mockops.NewMockVaultSDK(t) + mockVaultPair: func(t *testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) { + sdk := sdkmock.NewMockVaultSDK(t) vault := &configurationv1alpha1.KongVault{ ObjectMeta: metav1.ObjectMeta{ Name: "vault-1", @@ -341,13 +341,13 @@ func TestUpdateKongVault(t *testing.T) { func TestDeleteKongVault(t *testing.T) { testCases := []struct { name string - mockVaultPair func(*testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) + mockVaultPair func(*testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) expectedErr bool }{ { name: "success", - mockVaultPair: func(t *testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) { - sdk := mockops.NewMockVaultSDK(t) + mockVaultPair: func(t *testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) { + sdk := sdkmock.NewMockVaultSDK(t) vault := &configurationv1alpha1.KongVault{ ObjectMeta: metav1.ObjectMeta{ Name: "vault-1", @@ -370,8 +370,8 @@ func TestDeleteKongVault(t *testing.T) { }, { name: "fail", - mockVaultPair: func(t *testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) { - sdk := mockops.NewMockVaultSDK(t) + mockVaultPair: func(t *testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) { + sdk := sdkmock.NewMockVaultSDK(t) vault := &configurationv1alpha1.KongVault{ ObjectMeta: metav1.ObjectMeta{ Name: "vault-1", @@ -397,8 +397,8 @@ func TestDeleteKongVault(t *testing.T) { }, { name: "not found error treated as successful delete", - mockVaultPair: func(t *testing.T) (*mockops.MockVaultSDK, *configurationv1alpha1.KongVault) { - sdk := mockops.NewMockVaultSDK(t) + mockVaultPair: func(t *testing.T) (*sdkmock.MockVaultSDK, *configurationv1alpha1.KongVault) { + sdk := sdkmock.NewMockVaultSDK(t) vault := &configurationv1alpha1.KongVault{ ObjectMeta: metav1.ObjectMeta{ Name: "vault-1", diff --git a/controller/konnect/ops/mock/sdkfactory_mock.go b/controller/konnect/ops/sdk/mock/sdkfactory_mock.go similarity index 100% rename from controller/konnect/ops/mock/sdkfactory_mock.go rename to controller/konnect/ops/sdk/mock/sdkfactory_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.controlplane_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.controlplane_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.controlplane_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.controlplane_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.controlplanegroup_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.controlplanegroup_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.controlplanegroup_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.controlplanegroup_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.credentialacl_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.credentialacl_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.credentialacl_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.credentialacl_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.credentialapikey_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.credentialapikey_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.credentialapikey_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.credentialapikey_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.credentialbasicauth_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.credentialbasicauth_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.credentialbasicauth_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.credentialbasicauth_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.credentialhmac_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.credentialhmac_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.credentialhmac_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.credentialhmac_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.credentialjwt_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.credentialjwt_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.credentialjwt_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.credentialjwt_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongcacertificate_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongcacertificate_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongcacertificate_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongcacertificate_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongcertificate_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongcertificate_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongcertificate_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongcertificate_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongconsumer_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongconsumer_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongconsumer_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongconsumer_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongconsumergroup_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongconsumergroup_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongconsumergroup_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongconsumergroup_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongdataplanecertificate_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongdataplanecertificate_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongdataplanecertificate_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongdataplanecertificate_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongkey_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongkey_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongkey_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongkey_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongkeyset_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongkeyset_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongkeyset_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongkeyset_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongroute_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongroute_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongroute_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongroute_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongservice_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongservice_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongservice_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongservice_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongsni_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongsni_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongsni_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongsni_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongtarget_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongtarget_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongtarget_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongtarget_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongupstream_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongupstream_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongupstream_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongupstream_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.kongvault_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.kongvault_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.kongvault_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.kongvault_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.me_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.me_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.me_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.me_mock.go diff --git a/controller/konnect/ops/mock/zz_generated.plugin_mock.go b/controller/konnect/ops/sdk/mock/zz_generated.plugin_mock.go similarity index 100% rename from controller/konnect/ops/mock/zz_generated.plugin_mock.go rename to controller/konnect/ops/sdk/mock/zz_generated.plugin_mock.go diff --git a/test/envtest/kongconsumercredential_acl_test.go b/test/envtest/kongconsumercredential_acl_test.go index a56267449..3c3804146 100644 --- a/test/envtest/kongconsumercredential_acl_test.go +++ b/test/envtest/kongconsumercredential_acl_test.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -75,7 +75,7 @@ func TestKongConsumerCredential_ACL(t *testing.T) { "k8s-version:v1alpha1", } - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) factory.SDK.KongCredentialsACLSDK.EXPECT(). CreateACLWithConsumer( mock.Anything, diff --git a/test/envtest/kongconsumercredential_apikey_test.go b/test/envtest/kongconsumercredential_apikey_test.go index 61687ac90..b41ae0203 100644 --- a/test/envtest/kongconsumercredential_apikey_test.go +++ b/test/envtest/kongconsumercredential_apikey_test.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -74,7 +74,7 @@ func TestKongConsumerCredential_APIKey(t *testing.T) { "k8s-version:v1alpha1", } - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) factory.SDK.KongCredentialsAPIKeySDK.EXPECT(). CreateKeyAuthWithConsumer( mock.Anything, diff --git a/test/envtest/kongconsumercredential_basicauth_test.go b/test/envtest/kongconsumercredential_basicauth_test.go index b4088cea5..1240ac2e3 100644 --- a/test/envtest/kongconsumercredential_basicauth_test.go +++ b/test/envtest/kongconsumercredential_basicauth_test.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -76,7 +76,7 @@ func TestKongConsumerCredential_BasicAuth(t *testing.T) { "k8s-version:v1alpha1", } - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) factory.SDK.KongCredentialsBasicAuthSDK.EXPECT(). CreateBasicAuthWithConsumer( mock.Anything, diff --git a/test/envtest/kongconsumercredential_hmac_test.go b/test/envtest/kongconsumercredential_hmac_test.go index 1742df50c..d93e2f66e 100644 --- a/test/envtest/kongconsumercredential_hmac_test.go +++ b/test/envtest/kongconsumercredential_hmac_test.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -74,7 +74,7 @@ func TestKongConsumerCredential_HMAC(t *testing.T) { "k8s-version:v1alpha1", } - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) factory.SDK.KongCredentialsHMACSDK.EXPECT(). CreateHmacAuthWithConsumer( mock.Anything, diff --git a/test/envtest/kongconsumercredential_jwt_test.go b/test/envtest/kongconsumercredential_jwt_test.go index 08afb69e9..62b886b8f 100644 --- a/test/envtest/kongconsumercredential_jwt_test.go +++ b/test/envtest/kongconsumercredential_jwt_test.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -74,7 +74,7 @@ func TestKongConsumerCredential_JWT(t *testing.T) { "k8s-version:v1alpha1", } - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) factory.SDK.KongCredentialsJWTSDK.EXPECT(). CreateJwtWithConsumer( mock.Anything, diff --git a/test/envtest/kongpluginbinding_managed_test.go b/test/envtest/kongpluginbinding_managed_test.go index e7199b0ed..b8b9d10d0 100644 --- a/test/envtest/kongpluginbinding_managed_test.go +++ b/test/envtest/kongpluginbinding_managed_test.go @@ -19,7 +19,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/pkg/consts" @@ -54,7 +54,7 @@ func TestKongPluginBindingManaged(t *testing.T) { apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK require.NoError(t, manager.SetupCacheIndicesForKonnectTypes(ctx, mgr, false)) diff --git a/test/envtest/kongpluginbinding_unmanaged_test.go b/test/envtest/kongpluginbinding_unmanaged_test.go index 0b516e7b7..b78a776f8 100644 --- a/test/envtest/kongpluginbinding_unmanaged_test.go +++ b/test/envtest/kongpluginbinding_unmanaged_test.go @@ -18,7 +18,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/pkg/consts" @@ -47,7 +47,7 @@ func TestKongPluginBindingUnmanaged(t *testing.T) { apiAuth := deploy.KonnectAPIAuthConfigurationWithProgrammed(t, ctx, clientNamespaced) cp := deploy.KonnectGatewayControlPlaneWithID(t, ctx, clientNamespaced, apiAuth) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK require.NoError(t, manager.SetupCacheIndicesForKonnectTypes(ctx, mgr, false)) diff --git a/test/envtest/konnect_entities_gatewaycontrolplane_test.go b/test/envtest/konnect_entities_gatewaycontrolplane_test.go index e6ade9024..589e83641 100644 --- a/test/envtest/konnect_entities_gatewaycontrolplane_test.go +++ b/test/envtest/konnect_entities_gatewaycontrolplane_test.go @@ -20,7 +20,7 @@ import ( "github.com/kong/gateway-operator/controller/konnect" "github.com/kong/gateway-operator/controller/konnect/ops" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/test/helpers/deploy" konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1" @@ -40,7 +40,7 @@ var konnectGatewayControlPlaneTestCases = []konnectEntityReconcilerTestCase{ }, ) }, - mockExpectations: func(t *testing.T, sdk *mockops.MockSDKWrapper, cl client.Client, ns *corev1.Namespace) { + mockExpectations: func(t *testing.T, sdk *sdkmock.MockSDKWrapper, cl client.Client, ns *corev1.Namespace) { sdk.ControlPlaneSDK.EXPECT(). CreateControlPlane( mock.Anything, @@ -109,7 +109,7 @@ var konnectGatewayControlPlaneTestCases = []konnectEntityReconcilerTestCase{ }, ) }, - mockExpectations: func(t *testing.T, sdk *mockops.MockSDKWrapper, cl client.Client, ns *corev1.Namespace) { + mockExpectations: func(t *testing.T, sdk *sdkmock.MockSDKWrapper, cl client.Client, ns *corev1.Namespace) { sdk.ControlPlaneSDK.EXPECT(). CreateControlPlane( mock.Anything, @@ -252,7 +252,7 @@ var konnectGatewayControlPlaneTestCases = []konnectEntityReconcilerTestCase{ }, ) }, - mockExpectations: func(t *testing.T, sdk *mockops.MockSDKWrapper, cl client.Client, ns *corev1.Namespace) { + mockExpectations: func(t *testing.T, sdk *sdkmock.MockSDKWrapper, cl client.Client, ns *corev1.Namespace) { sdk.ControlPlaneSDK.EXPECT(). CreateControlPlane( mock.Anything, @@ -384,7 +384,7 @@ var konnectGatewayControlPlaneTestCases = []konnectEntityReconcilerTestCase{ }, ) }, - mockExpectations: func(t *testing.T, sdk *mockops.MockSDKWrapper, cl client.Client, ns *corev1.Namespace) { + mockExpectations: func(t *testing.T, sdk *sdkmock.MockSDKWrapper, cl client.Client, ns *corev1.Namespace) { sdk.ControlPlaneSDK.EXPECT(). CreateControlPlane( mock.Anything, diff --git a/test/envtest/konnect_entities_kongcacertificate_test.go b/test/envtest/konnect_entities_kongcacertificate_test.go index 20bfb271a..1fb84eba2 100644 --- a/test/envtest/konnect_entities_kongcacertificate_test.go +++ b/test/envtest/konnect_entities_kongcacertificate_test.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -31,7 +31,7 @@ func TestKongCACertificate(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK StartReconcilers(ctx, t, mgr, logs, konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongcertificate_test.go b/test/envtest/konnect_entities_kongcertificate_test.go index f4d017a40..d6e05e9ff 100644 --- a/test/envtest/konnect_entities_kongcertificate_test.go +++ b/test/envtest/konnect_entities_kongcertificate_test.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -31,7 +31,7 @@ func TestKongCertificate(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK StartReconcilers(ctx, t, mgr, logs, konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongconsumer_test.go b/test/envtest/konnect_entities_kongconsumer_test.go index 20e7f59a4..4095aa2d0 100644 --- a/test/envtest/konnect_entities_kongconsumer_test.go +++ b/test/envtest/konnect_entities_kongconsumer_test.go @@ -18,7 +18,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -35,7 +35,7 @@ func TestKongConsumer(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK reconcilers := []Reconciler{ konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongconsumergroup_test.go b/test/envtest/konnect_entities_kongconsumergroup_test.go index 5e67540ca..93e17aea8 100644 --- a/test/envtest/konnect_entities_kongconsumergroup_test.go +++ b/test/envtest/konnect_entities_kongconsumergroup_test.go @@ -19,7 +19,7 @@ import ( "github.com/kong/gateway-operator/controller/konnect" "github.com/kong/gateway-operator/controller/konnect/ops" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -35,7 +35,7 @@ func TestKongConsumerGroup(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK reconcilers := []Reconciler{ konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongdataplaneclientcertificate_test.go b/test/envtest/konnect_entities_kongdataplaneclientcertificate_test.go index 8a550a9d5..2d29e0a79 100644 --- a/test/envtest/konnect_entities_kongdataplaneclientcertificate_test.go +++ b/test/envtest/konnect_entities_kongdataplaneclientcertificate_test.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -31,7 +31,7 @@ func TestKongDataPlaneClientCertificate(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK StartReconcilers(ctx, t, mgr, logs, konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongkey_test.go b/test/envtest/konnect_entities_kongkey_test.go index 63f1164f2..6f284cdcc 100644 --- a/test/envtest/konnect_entities_kongkey_test.go +++ b/test/envtest/konnect_entities_kongkey_test.go @@ -17,7 +17,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -41,7 +41,7 @@ func TestKongKey(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK StartReconcilers(ctx, t, mgr, logs, konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongkeyset_test.go b/test/envtest/konnect_entities_kongkeyset_test.go index d19ee1722..3568f4a92 100644 --- a/test/envtest/konnect_entities_kongkeyset_test.go +++ b/test/envtest/konnect_entities_kongkeyset_test.go @@ -17,7 +17,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -38,7 +38,7 @@ func TestKongKeySet(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK StartReconcilers(ctx, t, mgr, logs, konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongroute_test.go b/test/envtest/konnect_entities_kongroute_test.go index 6c99a00e4..57436c154 100644 --- a/test/envtest/konnect_entities_kongroute_test.go +++ b/test/envtest/konnect_entities_kongroute_test.go @@ -16,7 +16,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -32,7 +32,7 @@ func TestKongRoute(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK StartReconcilers(ctx, t, mgr, logs, konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongservice_test.go b/test/envtest/konnect_entities_kongservice_test.go index d544d7089..bd5dcb372 100644 --- a/test/envtest/konnect_entities_kongservice_test.go +++ b/test/envtest/konnect_entities_kongservice_test.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -31,7 +31,7 @@ func TestKongService(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK StartReconcilers(ctx, t, mgr, logs, konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongsni_test.go b/test/envtest/konnect_entities_kongsni_test.go index f005305db..bd33e0873 100644 --- a/test/envtest/konnect_entities_kongsni_test.go +++ b/test/envtest/konnect_entities_kongsni_test.go @@ -16,7 +16,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -32,7 +32,7 @@ func TestKongSNI(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK StartReconcilers(ctx, t, mgr, logs, konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongtarget_test.go b/test/envtest/konnect_entities_kongtarget_test.go index ed6e10c22..8377e2011 100644 --- a/test/envtest/konnect_entities_kongtarget_test.go +++ b/test/envtest/konnect_entities_kongtarget_test.go @@ -16,7 +16,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -31,7 +31,7 @@ func TestKongTarget(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK StartReconcilers(ctx, t, mgr, logs, konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongupstream_test.go b/test/envtest/konnect_entities_kongupstream_test.go index b1e99cc09..5b1a1c91d 100644 --- a/test/envtest/konnect_entities_kongupstream_test.go +++ b/test/envtest/konnect_entities_kongupstream_test.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" k8sutils "github.com/kong/gateway-operator/pkg/utils/kubernetes" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -31,7 +31,7 @@ func TestKongUpstream(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK StartReconcilers(ctx, t, mgr, logs, konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_kongvault_test.go b/test/envtest/konnect_entities_kongvault_test.go index 33389f8c3..d21088ec0 100644 --- a/test/envtest/konnect_entities_kongvault_test.go +++ b/test/envtest/konnect_entities_kongvault_test.go @@ -15,7 +15,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kong/gateway-operator/controller/konnect" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" "github.com/kong/gateway-operator/test/helpers/deploy" @@ -31,7 +31,7 @@ func TestKongVault(t *testing.T) { t.Log("Setting up the manager with reconcilers") mgr, logs := NewManager(t, ctx, cfg, scheme.Get()) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK reconcilers := []Reconciler{ konnect.NewKonnectEntityReconciler(factory, false, mgr.GetClient(), diff --git a/test/envtest/konnect_entities_suite_test.go b/test/envtest/konnect_entities_suite_test.go index ecd8d2df5..2c4636051 100644 --- a/test/envtest/konnect_entities_suite_test.go +++ b/test/envtest/konnect_entities_suite_test.go @@ -14,7 +14,7 @@ import ( "github.com/kong/gateway-operator/controller/konnect" "github.com/kong/gateway-operator/controller/konnect/constraints" - mockops "github.com/kong/gateway-operator/controller/konnect/ops/mock" + sdkmock "github.com/kong/gateway-operator/controller/konnect/ops/sdk/mock" "github.com/kong/gateway-operator/modules/manager/scheme" konnectv1alpha1 "github.com/kong/kubernetes-configuration/api/konnect/v1alpha1" @@ -31,7 +31,7 @@ func TestKonnectEntityReconcilers(t *testing.T) { type konnectEntityReconcilerTestCase struct { name string objectOps func(ctx context.Context, t *testing.T, cl client.Client, ns *corev1.Namespace) - mockExpectations func(t *testing.T, sdk *mockops.MockSDKWrapper, cl client.Client, ns *corev1.Namespace) + mockExpectations func(t *testing.T, sdk *sdkmock.MockSDKWrapper, cl client.Client, ns *corev1.Namespace) eventuallyPredicate func(ctx context.Context, t *assert.CollectT, cl client.Client, ns *corev1.Namespace) } @@ -65,7 +65,7 @@ func testNewKonnectEntityReconciler[ require.NoError(t, mgr.GetClient().Create(ctx, ns)) cl := client.NewNamespacedClient(mgr.GetClient(), ns.Name) - factory := mockops.NewMockSDKFactory(t) + factory := sdkmock.NewMockSDKFactory(t) sdk := factory.SDK StartReconcilers(ctx, t, mgr, logs, konnect.NewKonnectEntityReconciler[T, TEnt](factory, false, cl))