internal/inventory/azurefetcher/mock_activedirectory_provider.go (200 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 azurefetcher
import (
context "context"
models "github.com/microsoftgraph/msgraph-sdk-go/models"
mock "github.com/stretchr/testify/mock"
)
// mockActivedirectoryProvider is an autogenerated mock type for the activedirectoryProvider type
type mockActivedirectoryProvider struct {
mock.Mock
}
type mockActivedirectoryProvider_Expecter struct {
mock *mock.Mock
}
func (_m *mockActivedirectoryProvider) EXPECT() *mockActivedirectoryProvider_Expecter {
return &mockActivedirectoryProvider_Expecter{mock: &_m.Mock}
}
// ListDirectoryRoles provides a mock function with given fields: _a0
func (_m *mockActivedirectoryProvider) ListDirectoryRoles(_a0 context.Context) ([]*models.DirectoryRole, error) {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for ListDirectoryRoles")
}
var r0 []*models.DirectoryRole
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) ([]*models.DirectoryRole, error)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(context.Context) []*models.DirectoryRole); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*models.DirectoryRole)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(_a0)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockActivedirectoryProvider_ListDirectoryRoles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDirectoryRoles'
type mockActivedirectoryProvider_ListDirectoryRoles_Call struct {
*mock.Call
}
// ListDirectoryRoles is a helper method to define mock.On call
// - _a0 context.Context
func (_e *mockActivedirectoryProvider_Expecter) ListDirectoryRoles(_a0 interface{}) *mockActivedirectoryProvider_ListDirectoryRoles_Call {
return &mockActivedirectoryProvider_ListDirectoryRoles_Call{Call: _e.mock.On("ListDirectoryRoles", _a0)}
}
func (_c *mockActivedirectoryProvider_ListDirectoryRoles_Call) Run(run func(_a0 context.Context)) *mockActivedirectoryProvider_ListDirectoryRoles_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *mockActivedirectoryProvider_ListDirectoryRoles_Call) Return(_a0 []*models.DirectoryRole, _a1 error) *mockActivedirectoryProvider_ListDirectoryRoles_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockActivedirectoryProvider_ListDirectoryRoles_Call) RunAndReturn(run func(context.Context) ([]*models.DirectoryRole, error)) *mockActivedirectoryProvider_ListDirectoryRoles_Call {
_c.Call.Return(run)
return _c
}
// ListGroups provides a mock function with given fields: _a0
func (_m *mockActivedirectoryProvider) ListGroups(_a0 context.Context) ([]*models.Group, error) {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for ListGroups")
}
var r0 []*models.Group
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) ([]*models.Group, error)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(context.Context) []*models.Group); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*models.Group)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(_a0)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockActivedirectoryProvider_ListGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListGroups'
type mockActivedirectoryProvider_ListGroups_Call struct {
*mock.Call
}
// ListGroups is a helper method to define mock.On call
// - _a0 context.Context
func (_e *mockActivedirectoryProvider_Expecter) ListGroups(_a0 interface{}) *mockActivedirectoryProvider_ListGroups_Call {
return &mockActivedirectoryProvider_ListGroups_Call{Call: _e.mock.On("ListGroups", _a0)}
}
func (_c *mockActivedirectoryProvider_ListGroups_Call) Run(run func(_a0 context.Context)) *mockActivedirectoryProvider_ListGroups_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *mockActivedirectoryProvider_ListGroups_Call) Return(_a0 []*models.Group, _a1 error) *mockActivedirectoryProvider_ListGroups_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockActivedirectoryProvider_ListGroups_Call) RunAndReturn(run func(context.Context) ([]*models.Group, error)) *mockActivedirectoryProvider_ListGroups_Call {
_c.Call.Return(run)
return _c
}
// ListServicePrincipals provides a mock function with given fields: ctx
func (_m *mockActivedirectoryProvider) ListServicePrincipals(ctx context.Context) ([]*models.ServicePrincipal, error) {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for ListServicePrincipals")
}
var r0 []*models.ServicePrincipal
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) ([]*models.ServicePrincipal, error)); ok {
return rf(ctx)
}
if rf, ok := ret.Get(0).(func(context.Context) []*models.ServicePrincipal); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*models.ServicePrincipal)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockActivedirectoryProvider_ListServicePrincipals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListServicePrincipals'
type mockActivedirectoryProvider_ListServicePrincipals_Call struct {
*mock.Call
}
// ListServicePrincipals is a helper method to define mock.On call
// - ctx context.Context
func (_e *mockActivedirectoryProvider_Expecter) ListServicePrincipals(ctx interface{}) *mockActivedirectoryProvider_ListServicePrincipals_Call {
return &mockActivedirectoryProvider_ListServicePrincipals_Call{Call: _e.mock.On("ListServicePrincipals", ctx)}
}
func (_c *mockActivedirectoryProvider_ListServicePrincipals_Call) Run(run func(ctx context.Context)) *mockActivedirectoryProvider_ListServicePrincipals_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *mockActivedirectoryProvider_ListServicePrincipals_Call) Return(_a0 []*models.ServicePrincipal, _a1 error) *mockActivedirectoryProvider_ListServicePrincipals_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockActivedirectoryProvider_ListServicePrincipals_Call) RunAndReturn(run func(context.Context) ([]*models.ServicePrincipal, error)) *mockActivedirectoryProvider_ListServicePrincipals_Call {
_c.Call.Return(run)
return _c
}
// ListUsers provides a mock function with given fields: _a0
func (_m *mockActivedirectoryProvider) ListUsers(_a0 context.Context) ([]*models.User, error) {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for ListUsers")
}
var r0 []*models.User
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) ([]*models.User, error)); ok {
return rf(_a0)
}
if rf, ok := ret.Get(0).(func(context.Context) []*models.User); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*models.User)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(_a0)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockActivedirectoryProvider_ListUsers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListUsers'
type mockActivedirectoryProvider_ListUsers_Call struct {
*mock.Call
}
// ListUsers is a helper method to define mock.On call
// - _a0 context.Context
func (_e *mockActivedirectoryProvider_Expecter) ListUsers(_a0 interface{}) *mockActivedirectoryProvider_ListUsers_Call {
return &mockActivedirectoryProvider_ListUsers_Call{Call: _e.mock.On("ListUsers", _a0)}
}
func (_c *mockActivedirectoryProvider_ListUsers_Call) Run(run func(_a0 context.Context)) *mockActivedirectoryProvider_ListUsers_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *mockActivedirectoryProvider_ListUsers_Call) Return(_a0 []*models.User, _a1 error) *mockActivedirectoryProvider_ListUsers_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockActivedirectoryProvider_ListUsers_Call) RunAndReturn(run func(context.Context) ([]*models.User, error)) *mockActivedirectoryProvider_ListUsers_Call {
_c.Call.Return(run)
return _c
}
// newMockActivedirectoryProvider creates a new instance of mockActivedirectoryProvider. 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 newMockActivedirectoryProvider(t interface {
mock.TestingT
Cleanup(func())
}) *mockActivedirectoryProvider {
mock := &mockActivedirectoryProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}