internal/resources/providers/azurelib/inventory/mock_postgresql_provider_api.go (199 lines of code) (raw):

// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. // Code generated by mockery v2.53.3. DO NOT EDIT. package inventory import ( context "context" mock "github.com/stretchr/testify/mock" ) // MockPostgresqlProviderAPI is an autogenerated mock type for the PostgresqlProviderAPI type type MockPostgresqlProviderAPI struct { mock.Mock } type MockPostgresqlProviderAPI_Expecter struct { mock *mock.Mock } func (_m *MockPostgresqlProviderAPI) EXPECT() *MockPostgresqlProviderAPI_Expecter { return &MockPostgresqlProviderAPI_Expecter{mock: &_m.Mock} } // ListFlexiblePostgresConfigurations provides a mock function with given fields: ctx, subID, resourceGroup, serverName func (_m *MockPostgresqlProviderAPI) ListFlexiblePostgresConfigurations(ctx context.Context, subID string, resourceGroup string, serverName string) ([]AzureAsset, error) { ret := _m.Called(ctx, subID, resourceGroup, serverName) if len(ret) == 0 { panic("no return value specified for ListFlexiblePostgresConfigurations") } var r0 []AzureAsset var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, string, string) ([]AzureAsset, error)); ok { return rf(ctx, subID, resourceGroup, serverName) } if rf, ok := ret.Get(0).(func(context.Context, string, string, string) []AzureAsset); ok { r0 = rf(ctx, subID, resourceGroup, serverName) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]AzureAsset) } } if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { r1 = rf(ctx, subID, resourceGroup, serverName) } else { r1 = ret.Error(1) } return r0, r1 } // MockPostgresqlProviderAPI_ListFlexiblePostgresConfigurations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListFlexiblePostgresConfigurations' type MockPostgresqlProviderAPI_ListFlexiblePostgresConfigurations_Call struct { *mock.Call } // ListFlexiblePostgresConfigurations is a helper method to define mock.On call // - ctx context.Context // - subID string // - resourceGroup string // - serverName string func (_e *MockPostgresqlProviderAPI_Expecter) ListFlexiblePostgresConfigurations(ctx interface{}, subID interface{}, resourceGroup interface{}, serverName interface{}) *MockPostgresqlProviderAPI_ListFlexiblePostgresConfigurations_Call { return &MockPostgresqlProviderAPI_ListFlexiblePostgresConfigurations_Call{Call: _e.mock.On("ListFlexiblePostgresConfigurations", ctx, subID, resourceGroup, serverName)} } func (_c *MockPostgresqlProviderAPI_ListFlexiblePostgresConfigurations_Call) Run(run func(ctx context.Context, subID string, resourceGroup string, serverName string)) *MockPostgresqlProviderAPI_ListFlexiblePostgresConfigurations_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) }) return _c } func (_c *MockPostgresqlProviderAPI_ListFlexiblePostgresConfigurations_Call) Return(_a0 []AzureAsset, _a1 error) *MockPostgresqlProviderAPI_ListFlexiblePostgresConfigurations_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockPostgresqlProviderAPI_ListFlexiblePostgresConfigurations_Call) RunAndReturn(run func(context.Context, string, string, string) ([]AzureAsset, error)) *MockPostgresqlProviderAPI_ListFlexiblePostgresConfigurations_Call { _c.Call.Return(run) return _c } // ListFlexiblePostgresFirewallRules provides a mock function with given fields: ctx, subID, resourceGroup, serverName func (_m *MockPostgresqlProviderAPI) ListFlexiblePostgresFirewallRules(ctx context.Context, subID string, resourceGroup string, serverName string) ([]AzureAsset, error) { ret := _m.Called(ctx, subID, resourceGroup, serverName) if len(ret) == 0 { panic("no return value specified for ListFlexiblePostgresFirewallRules") } var r0 []AzureAsset var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, string, string) ([]AzureAsset, error)); ok { return rf(ctx, subID, resourceGroup, serverName) } if rf, ok := ret.Get(0).(func(context.Context, string, string, string) []AzureAsset); ok { r0 = rf(ctx, subID, resourceGroup, serverName) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]AzureAsset) } } if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { r1 = rf(ctx, subID, resourceGroup, serverName) } else { r1 = ret.Error(1) } return r0, r1 } // MockPostgresqlProviderAPI_ListFlexiblePostgresFirewallRules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListFlexiblePostgresFirewallRules' type MockPostgresqlProviderAPI_ListFlexiblePostgresFirewallRules_Call struct { *mock.Call } // ListFlexiblePostgresFirewallRules is a helper method to define mock.On call // - ctx context.Context // - subID string // - resourceGroup string // - serverName string func (_e *MockPostgresqlProviderAPI_Expecter) ListFlexiblePostgresFirewallRules(ctx interface{}, subID interface{}, resourceGroup interface{}, serverName interface{}) *MockPostgresqlProviderAPI_ListFlexiblePostgresFirewallRules_Call { return &MockPostgresqlProviderAPI_ListFlexiblePostgresFirewallRules_Call{Call: _e.mock.On("ListFlexiblePostgresFirewallRules", ctx, subID, resourceGroup, serverName)} } func (_c *MockPostgresqlProviderAPI_ListFlexiblePostgresFirewallRules_Call) Run(run func(ctx context.Context, subID string, resourceGroup string, serverName string)) *MockPostgresqlProviderAPI_ListFlexiblePostgresFirewallRules_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) }) return _c } func (_c *MockPostgresqlProviderAPI_ListFlexiblePostgresFirewallRules_Call) Return(_a0 []AzureAsset, _a1 error) *MockPostgresqlProviderAPI_ListFlexiblePostgresFirewallRules_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockPostgresqlProviderAPI_ListFlexiblePostgresFirewallRules_Call) RunAndReturn(run func(context.Context, string, string, string) ([]AzureAsset, error)) *MockPostgresqlProviderAPI_ListFlexiblePostgresFirewallRules_Call { _c.Call.Return(run) return _c } // ListSinglePostgresConfigurations provides a mock function with given fields: ctx, subID, resourceGroup, serverName func (_m *MockPostgresqlProviderAPI) ListSinglePostgresConfigurations(ctx context.Context, subID string, resourceGroup string, serverName string) ([]AzureAsset, error) { ret := _m.Called(ctx, subID, resourceGroup, serverName) if len(ret) == 0 { panic("no return value specified for ListSinglePostgresConfigurations") } var r0 []AzureAsset var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, string, string) ([]AzureAsset, error)); ok { return rf(ctx, subID, resourceGroup, serverName) } if rf, ok := ret.Get(0).(func(context.Context, string, string, string) []AzureAsset); ok { r0 = rf(ctx, subID, resourceGroup, serverName) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]AzureAsset) } } if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { r1 = rf(ctx, subID, resourceGroup, serverName) } else { r1 = ret.Error(1) } return r0, r1 } // MockPostgresqlProviderAPI_ListSinglePostgresConfigurations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSinglePostgresConfigurations' type MockPostgresqlProviderAPI_ListSinglePostgresConfigurations_Call struct { *mock.Call } // ListSinglePostgresConfigurations is a helper method to define mock.On call // - ctx context.Context // - subID string // - resourceGroup string // - serverName string func (_e *MockPostgresqlProviderAPI_Expecter) ListSinglePostgresConfigurations(ctx interface{}, subID interface{}, resourceGroup interface{}, serverName interface{}) *MockPostgresqlProviderAPI_ListSinglePostgresConfigurations_Call { return &MockPostgresqlProviderAPI_ListSinglePostgresConfigurations_Call{Call: _e.mock.On("ListSinglePostgresConfigurations", ctx, subID, resourceGroup, serverName)} } func (_c *MockPostgresqlProviderAPI_ListSinglePostgresConfigurations_Call) Run(run func(ctx context.Context, subID string, resourceGroup string, serverName string)) *MockPostgresqlProviderAPI_ListSinglePostgresConfigurations_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) }) return _c } func (_c *MockPostgresqlProviderAPI_ListSinglePostgresConfigurations_Call) Return(_a0 []AzureAsset, _a1 error) *MockPostgresqlProviderAPI_ListSinglePostgresConfigurations_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockPostgresqlProviderAPI_ListSinglePostgresConfigurations_Call) RunAndReturn(run func(context.Context, string, string, string) ([]AzureAsset, error)) *MockPostgresqlProviderAPI_ListSinglePostgresConfigurations_Call { _c.Call.Return(run) return _c } // ListSinglePostgresFirewallRules provides a mock function with given fields: ctx, subID, resourceGroup, serverName func (_m *MockPostgresqlProviderAPI) ListSinglePostgresFirewallRules(ctx context.Context, subID string, resourceGroup string, serverName string) ([]AzureAsset, error) { ret := _m.Called(ctx, subID, resourceGroup, serverName) if len(ret) == 0 { panic("no return value specified for ListSinglePostgresFirewallRules") } var r0 []AzureAsset var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, string, string) ([]AzureAsset, error)); ok { return rf(ctx, subID, resourceGroup, serverName) } if rf, ok := ret.Get(0).(func(context.Context, string, string, string) []AzureAsset); ok { r0 = rf(ctx, subID, resourceGroup, serverName) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]AzureAsset) } } if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { r1 = rf(ctx, subID, resourceGroup, serverName) } else { r1 = ret.Error(1) } return r0, r1 } // MockPostgresqlProviderAPI_ListSinglePostgresFirewallRules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSinglePostgresFirewallRules' type MockPostgresqlProviderAPI_ListSinglePostgresFirewallRules_Call struct { *mock.Call } // ListSinglePostgresFirewallRules is a helper method to define mock.On call // - ctx context.Context // - subID string // - resourceGroup string // - serverName string func (_e *MockPostgresqlProviderAPI_Expecter) ListSinglePostgresFirewallRules(ctx interface{}, subID interface{}, resourceGroup interface{}, serverName interface{}) *MockPostgresqlProviderAPI_ListSinglePostgresFirewallRules_Call { return &MockPostgresqlProviderAPI_ListSinglePostgresFirewallRules_Call{Call: _e.mock.On("ListSinglePostgresFirewallRules", ctx, subID, resourceGroup, serverName)} } func (_c *MockPostgresqlProviderAPI_ListSinglePostgresFirewallRules_Call) Run(run func(ctx context.Context, subID string, resourceGroup string, serverName string)) *MockPostgresqlProviderAPI_ListSinglePostgresFirewallRules_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) }) return _c } func (_c *MockPostgresqlProviderAPI_ListSinglePostgresFirewallRules_Call) Return(_a0 []AzureAsset, _a1 error) *MockPostgresqlProviderAPI_ListSinglePostgresFirewallRules_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockPostgresqlProviderAPI_ListSinglePostgresFirewallRules_Call) RunAndReturn(run func(context.Context, string, string, string) ([]AzureAsset, error)) *MockPostgresqlProviderAPI_ListSinglePostgresFirewallRules_Call { _c.Call.Return(run) return _c } // NewMockPostgresqlProviderAPI creates a new instance of MockPostgresqlProviderAPI. 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 NewMockPostgresqlProviderAPI(t interface { mock.TestingT Cleanup(func()) }) *MockPostgresqlProviderAPI { mock := &MockPostgresqlProviderAPI{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock }