internal/resources/providers/azurelib/auth/mock_azure_auth_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 auth import ( azidentity "github.com/Azure/azure-sdk-for-go/sdk/azidentity" mock "github.com/stretchr/testify/mock" ) // MockAzureAuthProviderAPI is an autogenerated mock type for the AzureAuthProviderAPI type type MockAzureAuthProviderAPI struct { mock.Mock } type MockAzureAuthProviderAPI_Expecter struct { mock *mock.Mock } func (_m *MockAzureAuthProviderAPI) EXPECT() *MockAzureAuthProviderAPI_Expecter { return &MockAzureAuthProviderAPI_Expecter{mock: &_m.Mock} } // FindCertificateCredential provides a mock function with given fields: tenantID, clientID, certPath, password, options func (_m *MockAzureAuthProviderAPI) FindCertificateCredential(tenantID string, clientID string, certPath string, password string, options *azidentity.ClientCertificateCredentialOptions) (*azidentity.ClientCertificateCredential, error) { ret := _m.Called(tenantID, clientID, certPath, password, options) if len(ret) == 0 { panic("no return value specified for FindCertificateCredential") } var r0 *azidentity.ClientCertificateCredential var r1 error if rf, ok := ret.Get(0).(func(string, string, string, string, *azidentity.ClientCertificateCredentialOptions) (*azidentity.ClientCertificateCredential, error)); ok { return rf(tenantID, clientID, certPath, password, options) } if rf, ok := ret.Get(0).(func(string, string, string, string, *azidentity.ClientCertificateCredentialOptions) *azidentity.ClientCertificateCredential); ok { r0 = rf(tenantID, clientID, certPath, password, options) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*azidentity.ClientCertificateCredential) } } if rf, ok := ret.Get(1).(func(string, string, string, string, *azidentity.ClientCertificateCredentialOptions) error); ok { r1 = rf(tenantID, clientID, certPath, password, options) } else { r1 = ret.Error(1) } return r0, r1 } // MockAzureAuthProviderAPI_FindCertificateCredential_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindCertificateCredential' type MockAzureAuthProviderAPI_FindCertificateCredential_Call struct { *mock.Call } // FindCertificateCredential is a helper method to define mock.On call // - tenantID string // - clientID string // - certPath string // - password string // - options *azidentity.ClientCertificateCredentialOptions func (_e *MockAzureAuthProviderAPI_Expecter) FindCertificateCredential(tenantID interface{}, clientID interface{}, certPath interface{}, password interface{}, options interface{}) *MockAzureAuthProviderAPI_FindCertificateCredential_Call { return &MockAzureAuthProviderAPI_FindCertificateCredential_Call{Call: _e.mock.On("FindCertificateCredential", tenantID, clientID, certPath, password, options)} } func (_c *MockAzureAuthProviderAPI_FindCertificateCredential_Call) Run(run func(tenantID string, clientID string, certPath string, password string, options *azidentity.ClientCertificateCredentialOptions)) *MockAzureAuthProviderAPI_FindCertificateCredential_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(string), args[1].(string), args[2].(string), args[3].(string), args[4].(*azidentity.ClientCertificateCredentialOptions)) }) return _c } func (_c *MockAzureAuthProviderAPI_FindCertificateCredential_Call) Return(_a0 *azidentity.ClientCertificateCredential, _a1 error) *MockAzureAuthProviderAPI_FindCertificateCredential_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockAzureAuthProviderAPI_FindCertificateCredential_Call) RunAndReturn(run func(string, string, string, string, *azidentity.ClientCertificateCredentialOptions) (*azidentity.ClientCertificateCredential, error)) *MockAzureAuthProviderAPI_FindCertificateCredential_Call { _c.Call.Return(run) return _c } // FindClientSecretCredentials provides a mock function with given fields: tenantID, clientID, clientSecret, options func (_m *MockAzureAuthProviderAPI) FindClientSecretCredentials(tenantID string, clientID string, clientSecret string, options *azidentity.ClientSecretCredentialOptions) (*azidentity.ClientSecretCredential, error) { ret := _m.Called(tenantID, clientID, clientSecret, options) if len(ret) == 0 { panic("no return value specified for FindClientSecretCredentials") } var r0 *azidentity.ClientSecretCredential var r1 error if rf, ok := ret.Get(0).(func(string, string, string, *azidentity.ClientSecretCredentialOptions) (*azidentity.ClientSecretCredential, error)); ok { return rf(tenantID, clientID, clientSecret, options) } if rf, ok := ret.Get(0).(func(string, string, string, *azidentity.ClientSecretCredentialOptions) *azidentity.ClientSecretCredential); ok { r0 = rf(tenantID, clientID, clientSecret, options) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*azidentity.ClientSecretCredential) } } if rf, ok := ret.Get(1).(func(string, string, string, *azidentity.ClientSecretCredentialOptions) error); ok { r1 = rf(tenantID, clientID, clientSecret, options) } else { r1 = ret.Error(1) } return r0, r1 } // MockAzureAuthProviderAPI_FindClientSecretCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindClientSecretCredentials' type MockAzureAuthProviderAPI_FindClientSecretCredentials_Call struct { *mock.Call } // FindClientSecretCredentials is a helper method to define mock.On call // - tenantID string // - clientID string // - clientSecret string // - options *azidentity.ClientSecretCredentialOptions func (_e *MockAzureAuthProviderAPI_Expecter) FindClientSecretCredentials(tenantID interface{}, clientID interface{}, clientSecret interface{}, options interface{}) *MockAzureAuthProviderAPI_FindClientSecretCredentials_Call { return &MockAzureAuthProviderAPI_FindClientSecretCredentials_Call{Call: _e.mock.On("FindClientSecretCredentials", tenantID, clientID, clientSecret, options)} } func (_c *MockAzureAuthProviderAPI_FindClientSecretCredentials_Call) Run(run func(tenantID string, clientID string, clientSecret string, options *azidentity.ClientSecretCredentialOptions)) *MockAzureAuthProviderAPI_FindClientSecretCredentials_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(string), args[1].(string), args[2].(string), args[3].(*azidentity.ClientSecretCredentialOptions)) }) return _c } func (_c *MockAzureAuthProviderAPI_FindClientSecretCredentials_Call) Return(_a0 *azidentity.ClientSecretCredential, _a1 error) *MockAzureAuthProviderAPI_FindClientSecretCredentials_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockAzureAuthProviderAPI_FindClientSecretCredentials_Call) RunAndReturn(run func(string, string, string, *azidentity.ClientSecretCredentialOptions) (*azidentity.ClientSecretCredential, error)) *MockAzureAuthProviderAPI_FindClientSecretCredentials_Call { _c.Call.Return(run) return _c } // FindDefaultCredentials provides a mock function with given fields: options func (_m *MockAzureAuthProviderAPI) FindDefaultCredentials(options *azidentity.DefaultAzureCredentialOptions) (*azidentity.DefaultAzureCredential, error) { ret := _m.Called(options) if len(ret) == 0 { panic("no return value specified for FindDefaultCredentials") } var r0 *azidentity.DefaultAzureCredential var r1 error if rf, ok := ret.Get(0).(func(*azidentity.DefaultAzureCredentialOptions) (*azidentity.DefaultAzureCredential, error)); ok { return rf(options) } if rf, ok := ret.Get(0).(func(*azidentity.DefaultAzureCredentialOptions) *azidentity.DefaultAzureCredential); ok { r0 = rf(options) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*azidentity.DefaultAzureCredential) } } if rf, ok := ret.Get(1).(func(*azidentity.DefaultAzureCredentialOptions) error); ok { r1 = rf(options) } else { r1 = ret.Error(1) } return r0, r1 } // MockAzureAuthProviderAPI_FindDefaultCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindDefaultCredentials' type MockAzureAuthProviderAPI_FindDefaultCredentials_Call struct { *mock.Call } // FindDefaultCredentials is a helper method to define mock.On call // - options *azidentity.DefaultAzureCredentialOptions func (_e *MockAzureAuthProviderAPI_Expecter) FindDefaultCredentials(options interface{}) *MockAzureAuthProviderAPI_FindDefaultCredentials_Call { return &MockAzureAuthProviderAPI_FindDefaultCredentials_Call{Call: _e.mock.On("FindDefaultCredentials", options)} } func (_c *MockAzureAuthProviderAPI_FindDefaultCredentials_Call) Run(run func(options *azidentity.DefaultAzureCredentialOptions)) *MockAzureAuthProviderAPI_FindDefaultCredentials_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*azidentity.DefaultAzureCredentialOptions)) }) return _c } func (_c *MockAzureAuthProviderAPI_FindDefaultCredentials_Call) Return(_a0 *azidentity.DefaultAzureCredential, _a1 error) *MockAzureAuthProviderAPI_FindDefaultCredentials_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockAzureAuthProviderAPI_FindDefaultCredentials_Call) RunAndReturn(run func(*azidentity.DefaultAzureCredentialOptions) (*azidentity.DefaultAzureCredential, error)) *MockAzureAuthProviderAPI_FindDefaultCredentials_Call { _c.Call.Return(run) return _c } // NewMockAzureAuthProviderAPI creates a new instance of MockAzureAuthProviderAPI. 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 NewMockAzureAuthProviderAPI(t interface { mock.TestingT Cleanup(func()) }) *MockAzureAuthProviderAPI { mock := &MockAzureAuthProviderAPI{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock }