// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" "bnema.dev/ermite/internal/ports" mock "github.com/stretchr/testify/mock" ) // NewVariableService creates a new instance of VariableService. 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 NewVariableService(t interface { mock.TestingT Cleanup(func()) }) *VariableService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &VariableService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // VariableService is an autogenerated mock type for the VariableService type type VariableService struct { mock.Mock } type VariableService_Expecter struct { mock *mock.Mock } func (_m *VariableService) EXPECT() *VariableService_Expecter { return &VariableService_Expecter{mock: &_m.Mock} } // DeleteVariable provides a mock function for the type VariableService func (_mock *VariableService) DeleteVariable(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string) error { ret := _mock.Called(ctx, p, scope, name) if len(ret) == 0 { panic("no return value specified for DeleteVariable") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, string) error); ok { r0 = returnFunc(ctx, p, scope, name) } else { r0 = ret.Error(0) } return r0 } // VariableService_DeleteVariable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteVariable' type VariableService_DeleteVariable_Call struct { *mock.Call } // DeleteVariable is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - scope domain.SettingsScope // - name string func (_e *VariableService_Expecter) DeleteVariable(ctx any, p any, scope any, name any) *VariableService_DeleteVariable_Call { return &VariableService_DeleteVariable_Call{Call: _e.mock.On("DeleteVariable", ctx, p, scope, name)} } func (_c *VariableService_DeleteVariable_Call) Run(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string)) *VariableService_DeleteVariable_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.SettingsScope if args[2] != nil { arg2 = args[2].(domain.SettingsScope) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *VariableService_DeleteVariable_Call) Return(err error) *VariableService_DeleteVariable_Call { _c.Call.Return(err) return _c } func (_c *VariableService_DeleteVariable_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string) error) *VariableService_DeleteVariable_Call { _c.Call.Return(run) return _c } // GetVariable provides a mock function for the type VariableService func (_mock *VariableService) GetVariable(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string) (domain.Variable, error) { ret := _mock.Called(ctx, p, scope, name) if len(ret) == 0 { panic("no return value specified for GetVariable") } var r0 domain.Variable var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, string) (domain.Variable, error)); ok { return returnFunc(ctx, p, scope, name) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, string) domain.Variable); ok { r0 = returnFunc(ctx, p, scope, name) } else { r0 = ret.Get(0).(domain.Variable) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.SettingsScope, string) error); ok { r1 = returnFunc(ctx, p, scope, name) } else { r1 = ret.Error(1) } return r0, r1 } // VariableService_GetVariable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVariable' type VariableService_GetVariable_Call struct { *mock.Call } // GetVariable is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - scope domain.SettingsScope // - name string func (_e *VariableService_Expecter) GetVariable(ctx any, p any, scope any, name any) *VariableService_GetVariable_Call { return &VariableService_GetVariable_Call{Call: _e.mock.On("GetVariable", ctx, p, scope, name)} } func (_c *VariableService_GetVariable_Call) Run(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string)) *VariableService_GetVariable_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.SettingsScope if args[2] != nil { arg2 = args[2].(domain.SettingsScope) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *VariableService_GetVariable_Call) Return(variable domain.Variable, err error) *VariableService_GetVariable_Call { _c.Call.Return(variable, err) return _c } func (_c *VariableService_GetVariable_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string) (domain.Variable, error)) *VariableService_GetVariable_Call { _c.Call.Return(run) return _c } // ListVariables provides a mock function for the type VariableService func (_mock *VariableService) ListVariables(ctx context.Context, p domain.Principal, scope domain.SettingsScope, size int, token string) (ports.VariablePage, error) { ret := _mock.Called(ctx, p, scope, size, token) if len(ret) == 0 { panic("no return value specified for ListVariables") } var r0 ports.VariablePage var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, int, string) (ports.VariablePage, error)); ok { return returnFunc(ctx, p, scope, size, token) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, int, string) ports.VariablePage); ok { r0 = returnFunc(ctx, p, scope, size, token) } else { r0 = ret.Get(0).(ports.VariablePage) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.SettingsScope, int, string) error); ok { r1 = returnFunc(ctx, p, scope, size, token) } else { r1 = ret.Error(1) } return r0, r1 } // VariableService_ListVariables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListVariables' type VariableService_ListVariables_Call struct { *mock.Call } // ListVariables is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - scope domain.SettingsScope // - size int // - token string func (_e *VariableService_Expecter) ListVariables(ctx any, p any, scope any, size any, token any) *VariableService_ListVariables_Call { return &VariableService_ListVariables_Call{Call: _e.mock.On("ListVariables", ctx, p, scope, size, token)} } func (_c *VariableService_ListVariables_Call) Run(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, size int, token string)) *VariableService_ListVariables_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.SettingsScope if args[2] != nil { arg2 = args[2].(domain.SettingsScope) } var arg3 int if args[3] != nil { arg3 = args[3].(int) } var arg4 string if args[4] != nil { arg4 = args[4].(string) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *VariableService_ListVariables_Call) Return(variablePage ports.VariablePage, err error) *VariableService_ListVariables_Call { _c.Call.Return(variablePage, err) return _c } func (_c *VariableService_ListVariables_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, size int, token string) (ports.VariablePage, error)) *VariableService_ListVariables_Call { _c.Call.Return(run) return _c } // SetVariable provides a mock function for the type VariableService func (_mock *VariableService) SetVariable(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string, value string) (domain.Variable, error) { ret := _mock.Called(ctx, p, scope, name, value) if len(ret) == 0 { panic("no return value specified for SetVariable") } var r0 domain.Variable var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, string, string) (domain.Variable, error)); ok { return returnFunc(ctx, p, scope, name, value) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, string, string) domain.Variable); ok { r0 = returnFunc(ctx, p, scope, name, value) } else { r0 = ret.Get(0).(domain.Variable) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.SettingsScope, string, string) error); ok { r1 = returnFunc(ctx, p, scope, name, value) } else { r1 = ret.Error(1) } return r0, r1 } // VariableService_SetVariable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetVariable' type VariableService_SetVariable_Call struct { *mock.Call } // SetVariable is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - scope domain.SettingsScope // - name string // - value string func (_e *VariableService_Expecter) SetVariable(ctx any, p any, scope any, name any, value any) *VariableService_SetVariable_Call { return &VariableService_SetVariable_Call{Call: _e.mock.On("SetVariable", ctx, p, scope, name, value)} } func (_c *VariableService_SetVariable_Call) Run(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string, value string)) *VariableService_SetVariable_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.SettingsScope if args[2] != nil { arg2 = args[2].(domain.SettingsScope) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } var arg4 string if args[4] != nil { arg4 = args[4].(string) } run( arg0, arg1, arg2, arg3, arg4, ) }) return _c } func (_c *VariableService_SetVariable_Call) Return(variable domain.Variable, err error) *VariableService_SetVariable_Call { _c.Call.Return(variable, err) return _c } func (_c *VariableService_SetVariable_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string, value string) (domain.Variable, error)) *VariableService_SetVariable_Call { _c.Call.Return(run) return _c }