internal/resources/providers/azurelib/inventory/mock_subscription_provider_api.go (155 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" ) // MockSubscriptionProviderAPI is an autogenerated mock type for the SubscriptionProviderAPI type type MockSubscriptionProviderAPI struct { mock.Mock } type MockSubscriptionProviderAPI_Expecter struct { mock *mock.Mock } func (_m *MockSubscriptionProviderAPI) EXPECT() *MockSubscriptionProviderAPI_Expecter { return &MockSubscriptionProviderAPI_Expecter{mock: &_m.Mock} } // ListLocations provides a mock function with given fields: ctx, subID func (_m *MockSubscriptionProviderAPI) ListLocations(ctx context.Context, subID string) ([]AzureAsset, error) { ret := _m.Called(ctx, subID) if len(ret) == 0 { panic("no return value specified for ListLocations") } var r0 []AzureAsset var r1 error if rf, ok := ret.Get(0).(func(context.Context, string) ([]AzureAsset, error)); ok { return rf(ctx, subID) } if rf, ok := ret.Get(0).(func(context.Context, string) []AzureAsset); ok { r0 = rf(ctx, subID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]AzureAsset) } } if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, subID) } else { r1 = ret.Error(1) } return r0, r1 } // MockSubscriptionProviderAPI_ListLocations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListLocations' type MockSubscriptionProviderAPI_ListLocations_Call struct { *mock.Call } // ListLocations is a helper method to define mock.On call // - ctx context.Context // - subID string func (_e *MockSubscriptionProviderAPI_Expecter) ListLocations(ctx interface{}, subID interface{}) *MockSubscriptionProviderAPI_ListLocations_Call { return &MockSubscriptionProviderAPI_ListLocations_Call{Call: _e.mock.On("ListLocations", ctx, subID)} } func (_c *MockSubscriptionProviderAPI_ListLocations_Call) Run(run func(ctx context.Context, subID string)) *MockSubscriptionProviderAPI_ListLocations_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string)) }) return _c } func (_c *MockSubscriptionProviderAPI_ListLocations_Call) Return(_a0 []AzureAsset, _a1 error) *MockSubscriptionProviderAPI_ListLocations_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockSubscriptionProviderAPI_ListLocations_Call) RunAndReturn(run func(context.Context, string) ([]AzureAsset, error)) *MockSubscriptionProviderAPI_ListLocations_Call { _c.Call.Return(run) return _c } // ListSubscriptions provides a mock function with given fields: ctx func (_m *MockSubscriptionProviderAPI) ListSubscriptions(ctx context.Context) ([]AzureAsset, error) { ret := _m.Called(ctx) if len(ret) == 0 { panic("no return value specified for ListSubscriptions") } var r0 []AzureAsset var r1 error if rf, ok := ret.Get(0).(func(context.Context) ([]AzureAsset, error)); ok { return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) []AzureAsset); ok { r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]AzureAsset) } } if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockSubscriptionProviderAPI_ListSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSubscriptions' type MockSubscriptionProviderAPI_ListSubscriptions_Call struct { *mock.Call } // ListSubscriptions is a helper method to define mock.On call // - ctx context.Context func (_e *MockSubscriptionProviderAPI_Expecter) ListSubscriptions(ctx interface{}) *MockSubscriptionProviderAPI_ListSubscriptions_Call { return &MockSubscriptionProviderAPI_ListSubscriptions_Call{Call: _e.mock.On("ListSubscriptions", ctx)} } func (_c *MockSubscriptionProviderAPI_ListSubscriptions_Call) Run(run func(ctx context.Context)) *MockSubscriptionProviderAPI_ListSubscriptions_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } func (_c *MockSubscriptionProviderAPI_ListSubscriptions_Call) Return(_a0 []AzureAsset, _a1 error) *MockSubscriptionProviderAPI_ListSubscriptions_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockSubscriptionProviderAPI_ListSubscriptions_Call) RunAndReturn(run func(context.Context) ([]AzureAsset, error)) *MockSubscriptionProviderAPI_ListSubscriptions_Call { _c.Call.Return(run) return _c } // ListTenants provides a mock function with given fields: ctx func (_m *MockSubscriptionProviderAPI) ListTenants(ctx context.Context) ([]AzureAsset, error) { ret := _m.Called(ctx) if len(ret) == 0 { panic("no return value specified for ListTenants") } var r0 []AzureAsset var r1 error if rf, ok := ret.Get(0).(func(context.Context) ([]AzureAsset, error)); ok { return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) []AzureAsset); ok { r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]AzureAsset) } } if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockSubscriptionProviderAPI_ListTenants_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTenants' type MockSubscriptionProviderAPI_ListTenants_Call struct { *mock.Call } // ListTenants is a helper method to define mock.On call // - ctx context.Context func (_e *MockSubscriptionProviderAPI_Expecter) ListTenants(ctx interface{}) *MockSubscriptionProviderAPI_ListTenants_Call { return &MockSubscriptionProviderAPI_ListTenants_Call{Call: _e.mock.On("ListTenants", ctx)} } func (_c *MockSubscriptionProviderAPI_ListTenants_Call) Run(run func(ctx context.Context)) *MockSubscriptionProviderAPI_ListTenants_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } func (_c *MockSubscriptionProviderAPI_ListTenants_Call) Return(_a0 []AzureAsset, _a1 error) *MockSubscriptionProviderAPI_ListTenants_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockSubscriptionProviderAPI_ListTenants_Call) RunAndReturn(run func(context.Context) ([]AzureAsset, error)) *MockSubscriptionProviderAPI_ListTenants_Call { _c.Call.Return(run) return _c } // NewMockSubscriptionProviderAPI creates a new instance of MockSubscriptionProviderAPI. 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 NewMockSubscriptionProviderAPI(t interface { mock.TestingT Cleanup(func()) }) *MockSubscriptionProviderAPI { mock := &MockSubscriptionProviderAPI{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock }