// 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" ) // NewArtifactService creates a new instance of ArtifactService. 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 NewArtifactService(t interface { mock.TestingT Cleanup(func()) }) *ArtifactService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &ArtifactService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // ArtifactService is an autogenerated mock type for the ArtifactService type type ArtifactService struct { mock.Mock } type ArtifactService_Expecter struct { mock *mock.Mock } func (_m *ArtifactService) EXPECT() *ArtifactService_Expecter { return &ArtifactService_Expecter{mock: &_m.Mock} } // DeleteArtifact provides a mock function for the type ArtifactService func (_mock *ArtifactService) DeleteArtifact(ctx context.Context, p domain.Principal, repo domain.RepoName, artifactID int64) error { ret := _mock.Called(ctx, p, repo, artifactID) if len(ret) == 0 { panic("no return value specified for DeleteArtifact") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64) error); ok { r0 = returnFunc(ctx, p, repo, artifactID) } else { r0 = ret.Error(0) } return r0 } // ArtifactService_DeleteArtifact_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteArtifact' type ArtifactService_DeleteArtifact_Call struct { *mock.Call } // DeleteArtifact is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - artifactID int64 func (_e *ArtifactService_Expecter) DeleteArtifact(ctx any, p any, repo any, artifactID any) *ArtifactService_DeleteArtifact_Call { return &ArtifactService_DeleteArtifact_Call{Call: _e.mock.On("DeleteArtifact", ctx, p, repo, artifactID)} } func (_c *ArtifactService_DeleteArtifact_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, artifactID int64)) *ArtifactService_DeleteArtifact_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 int64 if args[3] != nil { arg3 = args[3].(int64) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *ArtifactService_DeleteArtifact_Call) Return(err error) *ArtifactService_DeleteArtifact_Call { _c.Call.Return(err) return _c } func (_c *ArtifactService_DeleteArtifact_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, artifactID int64) error) *ArtifactService_DeleteArtifact_Call { _c.Call.Return(run) return _c } // DownloadArtifact provides a mock function for the type ArtifactService func (_mock *ArtifactService) DownloadArtifact(ctx context.Context, p domain.Principal, repo domain.RepoName, artifactID int64, offset int64, send func(ports.ArtifactChunk) error) error { ret := _mock.Called(ctx, p, repo, artifactID, offset, send) if len(ret) == 0 { panic("no return value specified for DownloadArtifact") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64, int64, func(ports.ArtifactChunk) error) error); ok { r0 = returnFunc(ctx, p, repo, artifactID, offset, send) } else { r0 = ret.Error(0) } return r0 } // ArtifactService_DownloadArtifact_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DownloadArtifact' type ArtifactService_DownloadArtifact_Call struct { *mock.Call } // DownloadArtifact is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - artifactID int64 // - offset int64 // - send func(ports.ArtifactChunk) error func (_e *ArtifactService_Expecter) DownloadArtifact(ctx any, p any, repo any, artifactID any, offset any, send any) *ArtifactService_DownloadArtifact_Call { return &ArtifactService_DownloadArtifact_Call{Call: _e.mock.On("DownloadArtifact", ctx, p, repo, artifactID, offset, send)} } func (_c *ArtifactService_DownloadArtifact_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, artifactID int64, offset int64, send func(ports.ArtifactChunk) error)) *ArtifactService_DownloadArtifact_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 int64 if args[3] != nil { arg3 = args[3].(int64) } var arg4 int64 if args[4] != nil { arg4 = args[4].(int64) } var arg5 func(ports.ArtifactChunk) error if args[5] != nil { arg5 = args[5].(func(ports.ArtifactChunk) error) } run( arg0, arg1, arg2, arg3, arg4, arg5, ) }) return _c } func (_c *ArtifactService_DownloadArtifact_Call) Return(err error) *ArtifactService_DownloadArtifact_Call { _c.Call.Return(err) return _c } func (_c *ArtifactService_DownloadArtifact_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, artifactID int64, offset int64, send func(ports.ArtifactChunk) error) error) *ArtifactService_DownloadArtifact_Call { _c.Call.Return(run) return _c } // ListArtifacts provides a mock function for the type ArtifactService func (_mock *ArtifactService) ListArtifacts(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64) (ports.ArtifactList, error) { ret := _mock.Called(ctx, p, repo, runID) if len(ret) == 0 { panic("no return value specified for ListArtifacts") } var r0 ports.ArtifactList var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64) (ports.ArtifactList, error)); ok { return returnFunc(ctx, p, repo, runID) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, int64) ports.ArtifactList); ok { r0 = returnFunc(ctx, p, repo, runID) } else { r0 = ret.Get(0).(ports.ArtifactList) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, int64) error); ok { r1 = returnFunc(ctx, p, repo, runID) } else { r1 = ret.Error(1) } return r0, r1 } // ArtifactService_ListArtifacts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListArtifacts' type ArtifactService_ListArtifacts_Call struct { *mock.Call } // ListArtifacts is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - runID int64 func (_e *ArtifactService_Expecter) ListArtifacts(ctx any, p any, repo any, runID any) *ArtifactService_ListArtifacts_Call { return &ArtifactService_ListArtifacts_Call{Call: _e.mock.On("ListArtifacts", ctx, p, repo, runID)} } func (_c *ArtifactService_ListArtifacts_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64)) *ArtifactService_ListArtifacts_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 int64 if args[3] != nil { arg3 = args[3].(int64) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *ArtifactService_ListArtifacts_Call) Return(artifactList ports.ArtifactList, err error) *ArtifactService_ListArtifacts_Call { _c.Call.Return(artifactList, err) return _c } func (_c *ArtifactService_ListArtifacts_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, runID int64) (ports.ArtifactList, error)) *ArtifactService_ListArtifacts_Call { _c.Call.Return(run) return _c }