* Use provider in Webhooks registration * First stab at using the new client * Simplify mock * Able to generate graph in OSS * Remove line already ensured by provider * Handle the K8s not found error as well * Commit regenerated wire file * Add the hack also for deletion * Fix secrets test util * Format file
97 lines
2.9 KiB
Go
97 lines
2.9 KiB
Go
// Code generated by mockery v2.52.4. DO NOT EDIT.
|
|
|
|
package secrets
|
|
|
|
import (
|
|
context "context"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
dynamic "k8s.io/client-go/dynamic"
|
|
)
|
|
|
|
// MockSecureValueClient is an autogenerated mock type for the SecureValueClient type
|
|
type MockSecureValueClient struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockSecureValueClient_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockSecureValueClient) EXPECT() *MockSecureValueClient_Expecter {
|
|
return &MockSecureValueClient_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Client provides a mock function with given fields: ctx, namespace
|
|
func (_m *MockSecureValueClient) Client(ctx context.Context, namespace string) (dynamic.ResourceInterface, error) {
|
|
ret := _m.Called(ctx, namespace)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Client")
|
|
}
|
|
|
|
var r0 dynamic.ResourceInterface
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) (dynamic.ResourceInterface, error)); ok {
|
|
return rf(ctx, namespace)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) dynamic.ResourceInterface); ok {
|
|
r0 = rf(ctx, namespace)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(dynamic.ResourceInterface)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, namespace)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockSecureValueClient_Client_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Client'
|
|
type MockSecureValueClient_Client_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Client is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - namespace string
|
|
func (_e *MockSecureValueClient_Expecter) Client(ctx interface{}, namespace interface{}) *MockSecureValueClient_Client_Call {
|
|
return &MockSecureValueClient_Client_Call{Call: _e.mock.On("Client", ctx, namespace)}
|
|
}
|
|
|
|
func (_c *MockSecureValueClient_Client_Call) Run(run func(ctx context.Context, namespace string)) *MockSecureValueClient_Client_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSecureValueClient_Client_Call) Return(_a0 dynamic.ResourceInterface, _a1 error) *MockSecureValueClient_Client_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockSecureValueClient_Client_Call) RunAndReturn(run func(context.Context, string) (dynamic.ResourceInterface, error)) *MockSecureValueClient_Client_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewMockSecureValueClient creates a new instance of MockSecureValueClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewMockSecureValueClient(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockSecureValueClient {
|
|
mock := &MockSecureValueClient{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|