// 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" ) // NewEnvironmentService creates a new instance of EnvironmentService. 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 NewEnvironmentService(t interface { mock.TestingT Cleanup(func()) }) *EnvironmentService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &EnvironmentService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // EnvironmentService is an autogenerated mock type for the EnvironmentService type type EnvironmentService struct { mock.Mock } type EnvironmentService_Expecter struct { mock *mock.Mock } func (_m *EnvironmentService) EXPECT() *EnvironmentService_Expecter { return &EnvironmentService_Expecter{mock: &_m.Mock} } // CreateEnvironment provides a mock function for the type EnvironmentService func (_mock *EnvironmentService) CreateEnvironment(ctx context.Context, p domain.Principal, repo domain.RepoName, name string) (domain.Environment, error) { ret := _mock.Called(ctx, p, repo, name) if len(ret) == 0 { panic("no return value specified for CreateEnvironment") } var r0 domain.Environment var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, string) (domain.Environment, error)); ok { return returnFunc(ctx, p, repo, name) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, string) domain.Environment); ok { r0 = returnFunc(ctx, p, repo, name) } else { r0 = ret.Get(0).(domain.Environment) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, string) error); ok { r1 = returnFunc(ctx, p, repo, name) } else { r1 = ret.Error(1) } return r0, r1 } // EnvironmentService_CreateEnvironment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEnvironment' type EnvironmentService_CreateEnvironment_Call struct { *mock.Call } // CreateEnvironment is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - name string func (_e *EnvironmentService_Expecter) CreateEnvironment(ctx any, p any, repo any, name any) *EnvironmentService_CreateEnvironment_Call { return &EnvironmentService_CreateEnvironment_Call{Call: _e.mock.On("CreateEnvironment", ctx, p, repo, name)} } func (_c *EnvironmentService_CreateEnvironment_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, name string)) *EnvironmentService_CreateEnvironment_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.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *EnvironmentService_CreateEnvironment_Call) Return(environment domain.Environment, err error) *EnvironmentService_CreateEnvironment_Call { _c.Call.Return(environment, err) return _c } func (_c *EnvironmentService_CreateEnvironment_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, name string) (domain.Environment, error)) *EnvironmentService_CreateEnvironment_Call { _c.Call.Return(run) return _c } // DeleteEnvironment provides a mock function for the type EnvironmentService func (_mock *EnvironmentService) DeleteEnvironment(ctx context.Context, p domain.Principal, repo domain.RepoName, name string) error { ret := _mock.Called(ctx, p, repo, name) if len(ret) == 0 { panic("no return value specified for DeleteEnvironment") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, string) error); ok { r0 = returnFunc(ctx, p, repo, name) } else { r0 = ret.Error(0) } return r0 } // EnvironmentService_DeleteEnvironment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteEnvironment' type EnvironmentService_DeleteEnvironment_Call struct { *mock.Call } // DeleteEnvironment is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - name string func (_e *EnvironmentService_Expecter) DeleteEnvironment(ctx any, p any, repo any, name any) *EnvironmentService_DeleteEnvironment_Call { return &EnvironmentService_DeleteEnvironment_Call{Call: _e.mock.On("DeleteEnvironment", ctx, p, repo, name)} } func (_c *EnvironmentService_DeleteEnvironment_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, name string)) *EnvironmentService_DeleteEnvironment_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.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *EnvironmentService_DeleteEnvironment_Call) Return(err error) *EnvironmentService_DeleteEnvironment_Call { _c.Call.Return(err) return _c } func (_c *EnvironmentService_DeleteEnvironment_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, name string) error) *EnvironmentService_DeleteEnvironment_Call { _c.Call.Return(run) return _c } // ListEnvironments provides a mock function for the type EnvironmentService func (_mock *EnvironmentService) ListEnvironments(ctx context.Context, p domain.Principal, repo domain.RepoName, size int, token string) (ports.EnvironmentPage, error) { ret := _mock.Called(ctx, p, repo, size, token) if len(ret) == 0 { panic("no return value specified for ListEnvironments") } var r0 ports.EnvironmentPage var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int, string) (ports.EnvironmentPage, error)); ok { return returnFunc(ctx, p, repo, size, token) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int, string) ports.EnvironmentPage); ok { r0 = returnFunc(ctx, p, repo, size, token) } else { r0 = ret.Get(0).(ports.EnvironmentPage) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, int, string) error); ok { r1 = returnFunc(ctx, p, repo, size, token) } else { r1 = ret.Error(1) } return r0, r1 } // EnvironmentService_ListEnvironments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEnvironments' type EnvironmentService_ListEnvironments_Call struct { *mock.Call } // ListEnvironments is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - size int // - token string func (_e *EnvironmentService_Expecter) ListEnvironments(ctx any, p any, repo any, size any, token any) *EnvironmentService_ListEnvironments_Call { return &EnvironmentService_ListEnvironments_Call{Call: _e.mock.On("ListEnvironments", ctx, p, repo, size, token)} } func (_c *EnvironmentService_ListEnvironments_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, size int, token string)) *EnvironmentService_ListEnvironments_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.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } 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 *EnvironmentService_ListEnvironments_Call) Return(environmentPage ports.EnvironmentPage, err error) *EnvironmentService_ListEnvironments_Call { _c.Call.Return(environmentPage, err) return _c } func (_c *EnvironmentService_ListEnvironments_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, size int, token string) (ports.EnvironmentPage, error)) *EnvironmentService_ListEnvironments_Call { _c.Call.Return(run) return _c }