Skip to content

Commit

Permalink
chore: refactor ops package
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca committed Oct 21, 2024
1 parent e358cb1 commit 7fcf16a
Show file tree
Hide file tree
Showing 97 changed files with 626 additions and 313 deletions.
4 changes: 2 additions & 2 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ inpackage: True
disable-version-string: True
with-expecter: True

filename: "{{ trimSuffix .InterfaceFile \".go\" | base | lower }}_mock.go"
dir: "{{ .InterfaceDir }}"
filename: "zz_generated.{{ trimSuffix .InterfaceFile \".go\" | base | lower }}_mock.go"
dir: "{{ .InterfaceDir }}/mocks"
mockname: "Mock{{ .InterfaceName }}"
outpkg: "{{ .PackageName }}"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package ops
package mock

import (
"testing"

"github.com/stretchr/testify/require"

sdkops "github.com/kong/gateway-operator/controller/konnect/ops/sdk"
)

type MockSDKWrapper struct {
Expand Down Expand Up @@ -31,7 +33,7 @@ type MockSDKWrapper struct {
DataPlaneCertificatesSDK *MockDataPlaneClientCertificatesSDK
}

var _ SDKWrapper = MockSDKWrapper{}
var _ sdkops.SDKWrapper = MockSDKWrapper{}

func NewMockSDKWrapperWithT(t *testing.T) *MockSDKWrapper {
return &MockSDKWrapper{
Expand Down Expand Up @@ -60,91 +62,91 @@ func NewMockSDKWrapperWithT(t *testing.T) *MockSDKWrapper {
}
}

func (m MockSDKWrapper) GetControlPlaneSDK() ControlPlaneSDK {
func (m MockSDKWrapper) GetControlPlaneSDK() sdkops.ControlPlaneSDK {
return m.ControlPlaneSDK
}

func (m MockSDKWrapper) GetControlPlaneGroupSDK() ControlPlaneGroupSDK {
func (m MockSDKWrapper) GetControlPlaneGroupSDK() sdkops.ControlPlaneGroupSDK {
return m.ControlPlaneGroupSDK
}

func (m MockSDKWrapper) GetServicesSDK() ServicesSDK {
func (m MockSDKWrapper) GetServicesSDK() sdkops.ServicesSDK {
return m.ServicesSDK
}

func (m MockSDKWrapper) GetRoutesSDK() RoutesSDK {
func (m MockSDKWrapper) GetRoutesSDK() sdkops.RoutesSDK {
return m.RoutesSDK
}

func (m MockSDKWrapper) GetConsumersSDK() ConsumersSDK {
func (m MockSDKWrapper) GetConsumersSDK() sdkops.ConsumersSDK {
return m.ConsumersSDK
}

func (m MockSDKWrapper) GetConsumerGroupsSDK() ConsumerGroupSDK {
func (m MockSDKWrapper) GetConsumerGroupsSDK() sdkops.ConsumerGroupSDK {
return m.ConsumerGroupSDK
}

func (m MockSDKWrapper) GetPluginSDK() PluginSDK {
func (m MockSDKWrapper) GetPluginSDK() sdkops.PluginSDK {
return m.PluginSDK
}

func (m MockSDKWrapper) GetUpstreamsSDK() UpstreamsSDK {
func (m MockSDKWrapper) GetUpstreamsSDK() sdkops.UpstreamsSDK {
return m.UpstreamsSDK
}

func (m MockSDKWrapper) GetBasicAuthCredentialsSDK() KongCredentialBasicAuthSDK {
func (m MockSDKWrapper) GetBasicAuthCredentialsSDK() sdkops.KongCredentialBasicAuthSDK {
return m.KongCredentialsBasicAuthSDK
}

func (m MockSDKWrapper) GetAPIKeyCredentialsSDK() KongCredentialAPIKeySDK {
func (m MockSDKWrapper) GetAPIKeyCredentialsSDK() sdkops.KongCredentialAPIKeySDK {
return m.KongCredentialsAPIKeySDK
}

func (m MockSDKWrapper) GetACLCredentialsSDK() KongCredentialACLSDK {
func (m MockSDKWrapper) GetACLCredentialsSDK() sdkops.KongCredentialACLSDK {
return m.KongCredentialsACLSDK
}

func (m MockSDKWrapper) GetJWTCredentialsSDK() KongCredentialJWTSDK {
func (m MockSDKWrapper) GetJWTCredentialsSDK() sdkops.KongCredentialJWTSDK {
return m.KongCredentialsJWTSDK
}

func (m MockSDKWrapper) GetHMACCredentialsSDK() KongCredentialHMACSDK {
func (m MockSDKWrapper) GetHMACCredentialsSDK() sdkops.KongCredentialHMACSDK {
return m.KongCredentialsHMACSDK
}

func (m MockSDKWrapper) GetTargetsSDK() TargetsSDK {
func (m MockSDKWrapper) GetTargetsSDK() sdkops.TargetsSDK {
return m.TargetsSDK
}

func (m MockSDKWrapper) GetVaultSDK() VaultSDK {
func (m MockSDKWrapper) GetVaultSDK() sdkops.VaultSDK {
return m.VaultSDK
}

func (m MockSDKWrapper) GetMeSDK() MeSDK {
func (m MockSDKWrapper) GetMeSDK() sdkops.MeSDK {
return m.MeSDK
}

func (m MockSDKWrapper) GetCACertificatesSDK() CACertificatesSDK {
func (m MockSDKWrapper) GetCACertificatesSDK() sdkops.CACertificatesSDK {
return m.CACertificatesSDK
}

func (m MockSDKWrapper) GetCertificatesSDK() CertificatesSDK {
func (m MockSDKWrapper) GetCertificatesSDK() sdkops.CertificatesSDK {
return m.CertificatesSDK
}

func (m MockSDKWrapper) GetKeysSDK() KeysSDK {
func (m MockSDKWrapper) GetKeysSDK() sdkops.KeysSDK {
return m.KeysSDK
}

func (m MockSDKWrapper) GetKeySetsSDK() KeySetsSDK {
func (m MockSDKWrapper) GetKeySetsSDK() sdkops.KeySetsSDK {
return m.KeySetsSDK
}

func (m MockSDKWrapper) GetSNIsSDK() SNIsSDK {
func (m MockSDKWrapper) GetSNIsSDK() sdkops.SNIsSDK {
return m.SNIsSDK
}

func (m MockSDKWrapper) GetDataPlaneCertificatesSDK() DataPlaneClientCertificatesSDK {
func (m MockSDKWrapper) GetDataPlaneCertificatesSDK() sdkops.DataPlaneClientCertificatesSDK {
return m.DataPlaneCertificatesSDK
}

Expand All @@ -153,7 +155,7 @@ type MockSDKFactory struct {
SDK *MockSDKWrapper
}

var _ SDKFactory = MockSDKFactory{}
var _ sdkops.SDKFactory = MockSDKFactory{}

func NewMockSDKFactory(t *testing.T) *MockSDKFactory {
return &MockSDKFactory{
Expand All @@ -162,7 +164,7 @@ func NewMockSDKFactory(t *testing.T) *MockSDKFactory {
}
}

func (m MockSDKFactory) NewKonnectSDK(_ string, _ SDKToken) SDKWrapper {
func (m MockSDKFactory) NewKonnectSDK(_ string, _ sdkops.SDKToken) sdkops.SDKWrapper {
require.NotNil(m.t, m.SDK)
return *m.SDK
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7fcf16a

Please sign in to comment.