From 9cb1f5e3f74ed046ab4515ea575ab5bd09a32da5 Mon Sep 17 00:00:00 2001 From: David Juhasz Date: Thu, 22 Feb 2024 16:24:09 -0800 Subject: [PATCH] Standardize watcher Download() interface Fixes #868 - Update existing watcher Download() method and interface signatures to take a destination filepath (string) instead of an io.Writer stream - Add a `filewatcher.Download()` method - Create a `minio.Download()` method and move implementation specific code from `serviceImpl.Download()` to it - Update mocks --- internal/api/auth/fake/mock_ticket_store.go | 43 ++-- internal/package_/fake/mock_package_.go | 169 ++++++------- internal/persistence/fake/mock_persistence.go | 29 +-- internal/sftp/fake/mock_sftp.go | 99 ++++---- internal/storage/fake/mock_storage.go | 239 +++++++++--------- .../persistence/fake/mock_persistence.go | 127 +++++----- internal/upload/fake/mock_upload.go | 43 ++-- internal/watcher/fake/mock_service.go | 74 +++--- internal/watcher/fake/mock_watcher.go | 137 ++++++---- internal/watcher/filesystem.go | 12 + internal/watcher/minio.go | 29 +++ internal/watcher/watcher.go | 30 +-- internal/workflow/activities/download.go | 12 +- internal/workflow/activities/download_test.go | 20 +- 14 files changed, 559 insertions(+), 504 deletions(-) diff --git a/internal/api/auth/fake/mock_ticket_store.go b/internal/api/auth/fake/mock_ticket_store.go index cf964ad10..0e9332f83 100644 --- a/internal/api/auth/fake/mock_ticket_store.go +++ b/internal/api/auth/fake/mock_ticket_store.go @@ -5,7 +5,6 @@ // // mockgen -typed -destination=./internal/api/auth/fake/mock_ticket_store.go -package=fake github.com/artefactual-sdps/enduro/internal/api/auth TicketStore // - // Package fake is a generated GoMock package. package fake @@ -49,31 +48,31 @@ func (m *MockTicketStore) Close() error { } // Close indicates an expected call of Close. -func (mr *MockTicketStoreMockRecorder) Close() *MockTicketStoreCloseCall { +func (mr *MockTicketStoreMockRecorder) Close() *TicketStoreCloseCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockTicketStore)(nil).Close)) - return &MockTicketStoreCloseCall{Call: call} + return &TicketStoreCloseCall{Call: call} } -// MockTicketStoreCloseCall wrap *gomock.Call -type MockTicketStoreCloseCall struct { +// TicketStoreCloseCall wrap *gomock.Call +type TicketStoreCloseCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockTicketStoreCloseCall) Return(arg0 error) *MockTicketStoreCloseCall { +func (c *TicketStoreCloseCall) Return(arg0 error) *TicketStoreCloseCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockTicketStoreCloseCall) Do(f func() error) *MockTicketStoreCloseCall { +func (c *TicketStoreCloseCall) Do(f func() error) *TicketStoreCloseCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockTicketStoreCloseCall) DoAndReturn(f func() error) *MockTicketStoreCloseCall { +func (c *TicketStoreCloseCall) DoAndReturn(f func() error) *TicketStoreCloseCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -87,31 +86,31 @@ func (m *MockTicketStore) GetDel(arg0 context.Context, arg1 string) error { } // GetDel indicates an expected call of GetDel. -func (mr *MockTicketStoreMockRecorder) GetDel(arg0, arg1 any) *MockTicketStoreGetDelCall { +func (mr *MockTicketStoreMockRecorder) GetDel(arg0, arg1 any) *TicketStoreGetDelCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDel", reflect.TypeOf((*MockTicketStore)(nil).GetDel), arg0, arg1) - return &MockTicketStoreGetDelCall{Call: call} + return &TicketStoreGetDelCall{Call: call} } -// MockTicketStoreGetDelCall wrap *gomock.Call -type MockTicketStoreGetDelCall struct { +// TicketStoreGetDelCall wrap *gomock.Call +type TicketStoreGetDelCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockTicketStoreGetDelCall) Return(arg0 error) *MockTicketStoreGetDelCall { +func (c *TicketStoreGetDelCall) Return(arg0 error) *TicketStoreGetDelCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockTicketStoreGetDelCall) Do(f func(context.Context, string) error) *MockTicketStoreGetDelCall { +func (c *TicketStoreGetDelCall) Do(f func(context.Context, string) error) *TicketStoreGetDelCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockTicketStoreGetDelCall) DoAndReturn(f func(context.Context, string) error) *MockTicketStoreGetDelCall { +func (c *TicketStoreGetDelCall) DoAndReturn(f func(context.Context, string) error) *TicketStoreGetDelCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -125,31 +124,31 @@ func (m *MockTicketStore) SetEx(arg0 context.Context, arg1 string, arg2 time.Dur } // SetEx indicates an expected call of SetEx. -func (mr *MockTicketStoreMockRecorder) SetEx(arg0, arg1, arg2 any) *MockTicketStoreSetExCall { +func (mr *MockTicketStoreMockRecorder) SetEx(arg0, arg1, arg2 any) *TicketStoreSetExCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetEx", reflect.TypeOf((*MockTicketStore)(nil).SetEx), arg0, arg1, arg2) - return &MockTicketStoreSetExCall{Call: call} + return &TicketStoreSetExCall{Call: call} } -// MockTicketStoreSetExCall wrap *gomock.Call -type MockTicketStoreSetExCall struct { +// TicketStoreSetExCall wrap *gomock.Call +type TicketStoreSetExCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockTicketStoreSetExCall) Return(arg0 error) *MockTicketStoreSetExCall { +func (c *TicketStoreSetExCall) Return(arg0 error) *TicketStoreSetExCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockTicketStoreSetExCall) Do(f func(context.Context, string, time.Duration) error) *MockTicketStoreSetExCall { +func (c *TicketStoreSetExCall) Do(f func(context.Context, string, time.Duration) error) *TicketStoreSetExCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockTicketStoreSetExCall) DoAndReturn(f func(context.Context, string, time.Duration) error) *MockTicketStoreSetExCall { +func (c *TicketStoreSetExCall) DoAndReturn(f func(context.Context, string, time.Duration) error) *TicketStoreSetExCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/internal/package_/fake/mock_package_.go b/internal/package_/fake/mock_package_.go index 442a31c9e..b5db39898 100644 --- a/internal/package_/fake/mock_package_.go +++ b/internal/package_/fake/mock_package_.go @@ -5,7 +5,6 @@ // // mockgen -typed -destination=./internal/package_/fake/mock_package_.go -package=fake github.com/artefactual-sdps/enduro/internal/package_ Service // - // Package fake is a generated GoMock package. package fake @@ -52,31 +51,31 @@ func (m *MockService) CompletePreservationAction(arg0 context.Context, arg1 uint } // CompletePreservationAction indicates an expected call of CompletePreservationAction. -func (mr *MockServiceMockRecorder) CompletePreservationAction(arg0, arg1, arg2, arg3 any) *MockServiceCompletePreservationActionCall { +func (mr *MockServiceMockRecorder) CompletePreservationAction(arg0, arg1, arg2, arg3 any) *ServiceCompletePreservationActionCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CompletePreservationAction", reflect.TypeOf((*MockService)(nil).CompletePreservationAction), arg0, arg1, arg2, arg3) - return &MockServiceCompletePreservationActionCall{Call: call} + return &ServiceCompletePreservationActionCall{Call: call} } -// MockServiceCompletePreservationActionCall wrap *gomock.Call -type MockServiceCompletePreservationActionCall struct { +// ServiceCompletePreservationActionCall wrap *gomock.Call +type ServiceCompletePreservationActionCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceCompletePreservationActionCall) Return(arg0 error) *MockServiceCompletePreservationActionCall { +func (c *ServiceCompletePreservationActionCall) Return(arg0 error) *ServiceCompletePreservationActionCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceCompletePreservationActionCall) Do(f func(context.Context, uint, package_0.PreservationActionStatus, time.Time) error) *MockServiceCompletePreservationActionCall { +func (c *ServiceCompletePreservationActionCall) Do(f func(context.Context, uint, package_0.PreservationActionStatus, time.Time) error) *ServiceCompletePreservationActionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceCompletePreservationActionCall) DoAndReturn(f func(context.Context, uint, package_0.PreservationActionStatus, time.Time) error) *MockServiceCompletePreservationActionCall { +func (c *ServiceCompletePreservationActionCall) DoAndReturn(f func(context.Context, uint, package_0.PreservationActionStatus, time.Time) error) *ServiceCompletePreservationActionCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -90,31 +89,31 @@ func (m *MockService) CompletePreservationTask(arg0 context.Context, arg1 uint, } // CompletePreservationTask indicates an expected call of CompletePreservationTask. -func (mr *MockServiceMockRecorder) CompletePreservationTask(arg0, arg1, arg2, arg3, arg4 any) *MockServiceCompletePreservationTaskCall { +func (mr *MockServiceMockRecorder) CompletePreservationTask(arg0, arg1, arg2, arg3, arg4 any) *ServiceCompletePreservationTaskCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CompletePreservationTask", reflect.TypeOf((*MockService)(nil).CompletePreservationTask), arg0, arg1, arg2, arg3, arg4) - return &MockServiceCompletePreservationTaskCall{Call: call} + return &ServiceCompletePreservationTaskCall{Call: call} } -// MockServiceCompletePreservationTaskCall wrap *gomock.Call -type MockServiceCompletePreservationTaskCall struct { +// ServiceCompletePreservationTaskCall wrap *gomock.Call +type ServiceCompletePreservationTaskCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceCompletePreservationTaskCall) Return(arg0 error) *MockServiceCompletePreservationTaskCall { +func (c *ServiceCompletePreservationTaskCall) Return(arg0 error) *ServiceCompletePreservationTaskCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceCompletePreservationTaskCall) Do(f func(context.Context, uint, package_0.PreservationTaskStatus, time.Time, *string) error) *MockServiceCompletePreservationTaskCall { +func (c *ServiceCompletePreservationTaskCall) Do(f func(context.Context, uint, package_0.PreservationTaskStatus, time.Time, *string) error) *ServiceCompletePreservationTaskCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceCompletePreservationTaskCall) DoAndReturn(f func(context.Context, uint, package_0.PreservationTaskStatus, time.Time, *string) error) *MockServiceCompletePreservationTaskCall { +func (c *ServiceCompletePreservationTaskCall) DoAndReturn(f func(context.Context, uint, package_0.PreservationTaskStatus, time.Time, *string) error) *ServiceCompletePreservationTaskCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -128,31 +127,31 @@ func (m *MockService) Create(arg0 context.Context, arg1 *package_0.Package) erro } // Create indicates an expected call of Create. -func (mr *MockServiceMockRecorder) Create(arg0, arg1 any) *MockServiceCreateCall { +func (mr *MockServiceMockRecorder) Create(arg0, arg1 any) *ServiceCreateCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockService)(nil).Create), arg0, arg1) - return &MockServiceCreateCall{Call: call} + return &ServiceCreateCall{Call: call} } -// MockServiceCreateCall wrap *gomock.Call -type MockServiceCreateCall struct { +// ServiceCreateCall wrap *gomock.Call +type ServiceCreateCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceCreateCall) Return(arg0 error) *MockServiceCreateCall { +func (c *ServiceCreateCall) Return(arg0 error) *ServiceCreateCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceCreateCall) Do(f func(context.Context, *package_0.Package) error) *MockServiceCreateCall { +func (c *ServiceCreateCall) Do(f func(context.Context, *package_0.Package) error) *ServiceCreateCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceCreateCall) DoAndReturn(f func(context.Context, *package_0.Package) error) *MockServiceCreateCall { +func (c *ServiceCreateCall) DoAndReturn(f func(context.Context, *package_0.Package) error) *ServiceCreateCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -166,31 +165,31 @@ func (m *MockService) CreatePreservationAction(arg0 context.Context, arg1 *packa } // CreatePreservationAction indicates an expected call of CreatePreservationAction. -func (mr *MockServiceMockRecorder) CreatePreservationAction(arg0, arg1 any) *MockServiceCreatePreservationActionCall { +func (mr *MockServiceMockRecorder) CreatePreservationAction(arg0, arg1 any) *ServiceCreatePreservationActionCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePreservationAction", reflect.TypeOf((*MockService)(nil).CreatePreservationAction), arg0, arg1) - return &MockServiceCreatePreservationActionCall{Call: call} + return &ServiceCreatePreservationActionCall{Call: call} } -// MockServiceCreatePreservationActionCall wrap *gomock.Call -type MockServiceCreatePreservationActionCall struct { +// ServiceCreatePreservationActionCall wrap *gomock.Call +type ServiceCreatePreservationActionCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceCreatePreservationActionCall) Return(arg0 error) *MockServiceCreatePreservationActionCall { +func (c *ServiceCreatePreservationActionCall) Return(arg0 error) *ServiceCreatePreservationActionCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceCreatePreservationActionCall) Do(f func(context.Context, *package_0.PreservationAction) error) *MockServiceCreatePreservationActionCall { +func (c *ServiceCreatePreservationActionCall) Do(f func(context.Context, *package_0.PreservationAction) error) *ServiceCreatePreservationActionCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceCreatePreservationActionCall) DoAndReturn(f func(context.Context, *package_0.PreservationAction) error) *MockServiceCreatePreservationActionCall { +func (c *ServiceCreatePreservationActionCall) DoAndReturn(f func(context.Context, *package_0.PreservationAction) error) *ServiceCreatePreservationActionCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -204,31 +203,31 @@ func (m *MockService) CreatePreservationTask(arg0 context.Context, arg1 *package } // CreatePreservationTask indicates an expected call of CreatePreservationTask. -func (mr *MockServiceMockRecorder) CreatePreservationTask(arg0, arg1 any) *MockServiceCreatePreservationTaskCall { +func (mr *MockServiceMockRecorder) CreatePreservationTask(arg0, arg1 any) *ServiceCreatePreservationTaskCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePreservationTask", reflect.TypeOf((*MockService)(nil).CreatePreservationTask), arg0, arg1) - return &MockServiceCreatePreservationTaskCall{Call: call} + return &ServiceCreatePreservationTaskCall{Call: call} } -// MockServiceCreatePreservationTaskCall wrap *gomock.Call -type MockServiceCreatePreservationTaskCall struct { +// ServiceCreatePreservationTaskCall wrap *gomock.Call +type ServiceCreatePreservationTaskCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceCreatePreservationTaskCall) Return(arg0 error) *MockServiceCreatePreservationTaskCall { +func (c *ServiceCreatePreservationTaskCall) Return(arg0 error) *ServiceCreatePreservationTaskCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceCreatePreservationTaskCall) Do(f func(context.Context, *package_0.PreservationTask) error) *MockServiceCreatePreservationTaskCall { +func (c *ServiceCreatePreservationTaskCall) Do(f func(context.Context, *package_0.PreservationTask) error) *ServiceCreatePreservationTaskCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceCreatePreservationTaskCall) DoAndReturn(f func(context.Context, *package_0.PreservationTask) error) *MockServiceCreatePreservationTaskCall { +func (c *ServiceCreatePreservationTaskCall) DoAndReturn(f func(context.Context, *package_0.PreservationTask) error) *ServiceCreatePreservationTaskCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -242,31 +241,31 @@ func (m *MockService) Goa() package_.Service { } // Goa indicates an expected call of Goa. -func (mr *MockServiceMockRecorder) Goa() *MockServiceGoaCall { +func (mr *MockServiceMockRecorder) Goa() *ServiceGoaCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Goa", reflect.TypeOf((*MockService)(nil).Goa)) - return &MockServiceGoaCall{Call: call} + return &ServiceGoaCall{Call: call} } -// MockServiceGoaCall wrap *gomock.Call -type MockServiceGoaCall struct { +// ServiceGoaCall wrap *gomock.Call +type ServiceGoaCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceGoaCall) Return(arg0 package_.Service) *MockServiceGoaCall { +func (c *ServiceGoaCall) Return(arg0 package_.Service) *ServiceGoaCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceGoaCall) Do(f func() package_.Service) *MockServiceGoaCall { +func (c *ServiceGoaCall) Do(f func() package_.Service) *ServiceGoaCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceGoaCall) DoAndReturn(f func() package_.Service) *MockServiceGoaCall { +func (c *ServiceGoaCall) DoAndReturn(f func() package_.Service) *ServiceGoaCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -280,31 +279,31 @@ func (m *MockService) SetLocationID(arg0 context.Context, arg1 uint, arg2 uuid.U } // SetLocationID indicates an expected call of SetLocationID. -func (mr *MockServiceMockRecorder) SetLocationID(arg0, arg1, arg2 any) *MockServiceSetLocationIDCall { +func (mr *MockServiceMockRecorder) SetLocationID(arg0, arg1, arg2 any) *ServiceSetLocationIDCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLocationID", reflect.TypeOf((*MockService)(nil).SetLocationID), arg0, arg1, arg2) - return &MockServiceSetLocationIDCall{Call: call} + return &ServiceSetLocationIDCall{Call: call} } -// MockServiceSetLocationIDCall wrap *gomock.Call -type MockServiceSetLocationIDCall struct { +// ServiceSetLocationIDCall wrap *gomock.Call +type ServiceSetLocationIDCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceSetLocationIDCall) Return(arg0 error) *MockServiceSetLocationIDCall { +func (c *ServiceSetLocationIDCall) Return(arg0 error) *ServiceSetLocationIDCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceSetLocationIDCall) Do(f func(context.Context, uint, uuid.UUID) error) *MockServiceSetLocationIDCall { +func (c *ServiceSetLocationIDCall) Do(f func(context.Context, uint, uuid.UUID) error) *ServiceSetLocationIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceSetLocationIDCall) DoAndReturn(f func(context.Context, uint, uuid.UUID) error) *MockServiceSetLocationIDCall { +func (c *ServiceSetLocationIDCall) DoAndReturn(f func(context.Context, uint, uuid.UUID) error) *ServiceSetLocationIDCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -318,31 +317,31 @@ func (m *MockService) SetPreservationActionStatus(arg0 context.Context, arg1 uin } // SetPreservationActionStatus indicates an expected call of SetPreservationActionStatus. -func (mr *MockServiceMockRecorder) SetPreservationActionStatus(arg0, arg1, arg2 any) *MockServiceSetPreservationActionStatusCall { +func (mr *MockServiceMockRecorder) SetPreservationActionStatus(arg0, arg1, arg2 any) *ServiceSetPreservationActionStatusCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPreservationActionStatus", reflect.TypeOf((*MockService)(nil).SetPreservationActionStatus), arg0, arg1, arg2) - return &MockServiceSetPreservationActionStatusCall{Call: call} + return &ServiceSetPreservationActionStatusCall{Call: call} } -// MockServiceSetPreservationActionStatusCall wrap *gomock.Call -type MockServiceSetPreservationActionStatusCall struct { +// ServiceSetPreservationActionStatusCall wrap *gomock.Call +type ServiceSetPreservationActionStatusCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceSetPreservationActionStatusCall) Return(arg0 error) *MockServiceSetPreservationActionStatusCall { +func (c *ServiceSetPreservationActionStatusCall) Return(arg0 error) *ServiceSetPreservationActionStatusCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceSetPreservationActionStatusCall) Do(f func(context.Context, uint, package_0.PreservationActionStatus) error) *MockServiceSetPreservationActionStatusCall { +func (c *ServiceSetPreservationActionStatusCall) Do(f func(context.Context, uint, package_0.PreservationActionStatus) error) *ServiceSetPreservationActionStatusCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceSetPreservationActionStatusCall) DoAndReturn(f func(context.Context, uint, package_0.PreservationActionStatus) error) *MockServiceSetPreservationActionStatusCall { +func (c *ServiceSetPreservationActionStatusCall) DoAndReturn(f func(context.Context, uint, package_0.PreservationActionStatus) error) *ServiceSetPreservationActionStatusCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -356,31 +355,31 @@ func (m *MockService) SetStatus(arg0 context.Context, arg1 uint, arg2 package_0. } // SetStatus indicates an expected call of SetStatus. -func (mr *MockServiceMockRecorder) SetStatus(arg0, arg1, arg2 any) *MockServiceSetStatusCall { +func (mr *MockServiceMockRecorder) SetStatus(arg0, arg1, arg2 any) *ServiceSetStatusCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStatus", reflect.TypeOf((*MockService)(nil).SetStatus), arg0, arg1, arg2) - return &MockServiceSetStatusCall{Call: call} + return &ServiceSetStatusCall{Call: call} } -// MockServiceSetStatusCall wrap *gomock.Call -type MockServiceSetStatusCall struct { +// ServiceSetStatusCall wrap *gomock.Call +type ServiceSetStatusCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceSetStatusCall) Return(arg0 error) *MockServiceSetStatusCall { +func (c *ServiceSetStatusCall) Return(arg0 error) *ServiceSetStatusCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceSetStatusCall) Do(f func(context.Context, uint, package_0.Status) error) *MockServiceSetStatusCall { +func (c *ServiceSetStatusCall) Do(f func(context.Context, uint, package_0.Status) error) *ServiceSetStatusCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceSetStatusCall) DoAndReturn(f func(context.Context, uint, package_0.Status) error) *MockServiceSetStatusCall { +func (c *ServiceSetStatusCall) DoAndReturn(f func(context.Context, uint, package_0.Status) error) *ServiceSetStatusCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -394,31 +393,31 @@ func (m *MockService) SetStatusInProgress(arg0 context.Context, arg1 uint, arg2 } // SetStatusInProgress indicates an expected call of SetStatusInProgress. -func (mr *MockServiceMockRecorder) SetStatusInProgress(arg0, arg1, arg2 any) *MockServiceSetStatusInProgressCall { +func (mr *MockServiceMockRecorder) SetStatusInProgress(arg0, arg1, arg2 any) *ServiceSetStatusInProgressCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStatusInProgress", reflect.TypeOf((*MockService)(nil).SetStatusInProgress), arg0, arg1, arg2) - return &MockServiceSetStatusInProgressCall{Call: call} + return &ServiceSetStatusInProgressCall{Call: call} } -// MockServiceSetStatusInProgressCall wrap *gomock.Call -type MockServiceSetStatusInProgressCall struct { +// ServiceSetStatusInProgressCall wrap *gomock.Call +type ServiceSetStatusInProgressCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceSetStatusInProgressCall) Return(arg0 error) *MockServiceSetStatusInProgressCall { +func (c *ServiceSetStatusInProgressCall) Return(arg0 error) *ServiceSetStatusInProgressCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceSetStatusInProgressCall) Do(f func(context.Context, uint, time.Time) error) *MockServiceSetStatusInProgressCall { +func (c *ServiceSetStatusInProgressCall) Do(f func(context.Context, uint, time.Time) error) *ServiceSetStatusInProgressCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceSetStatusInProgressCall) DoAndReturn(f func(context.Context, uint, time.Time) error) *MockServiceSetStatusInProgressCall { +func (c *ServiceSetStatusInProgressCall) DoAndReturn(f func(context.Context, uint, time.Time) error) *ServiceSetStatusInProgressCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -432,31 +431,31 @@ func (m *MockService) SetStatusPending(arg0 context.Context, arg1 uint) error { } // SetStatusPending indicates an expected call of SetStatusPending. -func (mr *MockServiceMockRecorder) SetStatusPending(arg0, arg1 any) *MockServiceSetStatusPendingCall { +func (mr *MockServiceMockRecorder) SetStatusPending(arg0, arg1 any) *ServiceSetStatusPendingCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStatusPending", reflect.TypeOf((*MockService)(nil).SetStatusPending), arg0, arg1) - return &MockServiceSetStatusPendingCall{Call: call} + return &ServiceSetStatusPendingCall{Call: call} } -// MockServiceSetStatusPendingCall wrap *gomock.Call -type MockServiceSetStatusPendingCall struct { +// ServiceSetStatusPendingCall wrap *gomock.Call +type ServiceSetStatusPendingCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceSetStatusPendingCall) Return(arg0 error) *MockServiceSetStatusPendingCall { +func (c *ServiceSetStatusPendingCall) Return(arg0 error) *ServiceSetStatusPendingCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceSetStatusPendingCall) Do(f func(context.Context, uint) error) *MockServiceSetStatusPendingCall { +func (c *ServiceSetStatusPendingCall) Do(f func(context.Context, uint) error) *ServiceSetStatusPendingCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceSetStatusPendingCall) DoAndReturn(f func(context.Context, uint) error) *MockServiceSetStatusPendingCall { +func (c *ServiceSetStatusPendingCall) DoAndReturn(f func(context.Context, uint) error) *ServiceSetStatusPendingCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -470,31 +469,31 @@ func (m *MockService) UpdateWorkflowStatus(arg0 context.Context, arg1 uint, arg2 } // UpdateWorkflowStatus indicates an expected call of UpdateWorkflowStatus. -func (mr *MockServiceMockRecorder) UpdateWorkflowStatus(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 any) *MockServiceUpdateWorkflowStatusCall { +func (mr *MockServiceMockRecorder) UpdateWorkflowStatus(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 any) *ServiceUpdateWorkflowStatusCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkflowStatus", reflect.TypeOf((*MockService)(nil).UpdateWorkflowStatus), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) - return &MockServiceUpdateWorkflowStatusCall{Call: call} + return &ServiceUpdateWorkflowStatusCall{Call: call} } -// MockServiceUpdateWorkflowStatusCall wrap *gomock.Call -type MockServiceUpdateWorkflowStatusCall struct { +// ServiceUpdateWorkflowStatusCall wrap *gomock.Call +type ServiceUpdateWorkflowStatusCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceUpdateWorkflowStatusCall) Return(arg0 error) *MockServiceUpdateWorkflowStatusCall { +func (c *ServiceUpdateWorkflowStatusCall) Return(arg0 error) *ServiceUpdateWorkflowStatusCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceUpdateWorkflowStatusCall) Do(f func(context.Context, uint, string, string, string, string, package_0.Status, time.Time) error) *MockServiceUpdateWorkflowStatusCall { +func (c *ServiceUpdateWorkflowStatusCall) Do(f func(context.Context, uint, string, string, string, string, package_0.Status, time.Time) error) *ServiceUpdateWorkflowStatusCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceUpdateWorkflowStatusCall) DoAndReturn(f func(context.Context, uint, string, string, string, string, package_0.Status, time.Time) error) *MockServiceUpdateWorkflowStatusCall { +func (c *ServiceUpdateWorkflowStatusCall) DoAndReturn(f func(context.Context, uint, string, string, string, string, package_0.Status, time.Time) error) *ServiceUpdateWorkflowStatusCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/internal/persistence/fake/mock_persistence.go b/internal/persistence/fake/mock_persistence.go index 56bd7cb19..b4cae9159 100644 --- a/internal/persistence/fake/mock_persistence.go +++ b/internal/persistence/fake/mock_persistence.go @@ -5,7 +5,6 @@ // // mockgen -typed -destination=./internal/persistence/fake/mock_persistence.go -package=fake github.com/artefactual-sdps/enduro/internal/persistence Service // - // Package fake is a generated GoMock package. package fake @@ -51,31 +50,31 @@ func (m *MockService) CreatePackage(arg0 context.Context, arg1 *package_.Package } // CreatePackage indicates an expected call of CreatePackage. -func (mr *MockServiceMockRecorder) CreatePackage(arg0, arg1 any) *MockServiceCreatePackageCall { +func (mr *MockServiceMockRecorder) CreatePackage(arg0, arg1 any) *ServiceCreatePackageCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePackage", reflect.TypeOf((*MockService)(nil).CreatePackage), arg0, arg1) - return &MockServiceCreatePackageCall{Call: call} + return &ServiceCreatePackageCall{Call: call} } -// MockServiceCreatePackageCall wrap *gomock.Call -type MockServiceCreatePackageCall struct { +// ServiceCreatePackageCall wrap *gomock.Call +type ServiceCreatePackageCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceCreatePackageCall) Return(arg0 *package_.Package, arg1 error) *MockServiceCreatePackageCall { +func (c *ServiceCreatePackageCall) Return(arg0 *package_.Package, arg1 error) *ServiceCreatePackageCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceCreatePackageCall) Do(f func(context.Context, *package_.Package) (*package_.Package, error)) *MockServiceCreatePackageCall { +func (c *ServiceCreatePackageCall) Do(f func(context.Context, *package_.Package) (*package_.Package, error)) *ServiceCreatePackageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceCreatePackageCall) DoAndReturn(f func(context.Context, *package_.Package) (*package_.Package, error)) *MockServiceCreatePackageCall { +func (c *ServiceCreatePackageCall) DoAndReturn(f func(context.Context, *package_.Package) (*package_.Package, error)) *ServiceCreatePackageCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -90,31 +89,31 @@ func (m *MockService) UpdatePackage(arg0 context.Context, arg1 uint, arg2 persis } // UpdatePackage indicates an expected call of UpdatePackage. -func (mr *MockServiceMockRecorder) UpdatePackage(arg0, arg1, arg2 any) *MockServiceUpdatePackageCall { +func (mr *MockServiceMockRecorder) UpdatePackage(arg0, arg1, arg2 any) *ServiceUpdatePackageCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePackage", reflect.TypeOf((*MockService)(nil).UpdatePackage), arg0, arg1, arg2) - return &MockServiceUpdatePackageCall{Call: call} + return &ServiceUpdatePackageCall{Call: call} } -// MockServiceUpdatePackageCall wrap *gomock.Call -type MockServiceUpdatePackageCall struct { +// ServiceUpdatePackageCall wrap *gomock.Call +type ServiceUpdatePackageCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceUpdatePackageCall) Return(arg0 *package_.Package, arg1 error) *MockServiceUpdatePackageCall { +func (c *ServiceUpdatePackageCall) Return(arg0 *package_.Package, arg1 error) *ServiceUpdatePackageCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceUpdatePackageCall) Do(f func(context.Context, uint, persistence.PackageUpdater) (*package_.Package, error)) *MockServiceUpdatePackageCall { +func (c *ServiceUpdatePackageCall) Do(f func(context.Context, uint, persistence.PackageUpdater) (*package_.Package, error)) *ServiceUpdatePackageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceUpdatePackageCall) DoAndReturn(f func(context.Context, uint, persistence.PackageUpdater) (*package_.Package, error)) *MockServiceUpdatePackageCall { +func (c *ServiceUpdatePackageCall) DoAndReturn(f func(context.Context, uint, persistence.PackageUpdater) (*package_.Package, error)) *ServiceUpdatePackageCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/internal/sftp/fake/mock_sftp.go b/internal/sftp/fake/mock_sftp.go index 1608c166f..bf9809365 100644 --- a/internal/sftp/fake/mock_sftp.go +++ b/internal/sftp/fake/mock_sftp.go @@ -5,7 +5,6 @@ // // mockgen -typed -destination=./internal/sftp/fake/mock_sftp.go -package=fake github.com/artefactual-sdps/enduro/internal/sftp Client,AsyncUpload // - // Package fake is a generated GoMock package. package fake @@ -50,31 +49,31 @@ func (m *MockClient) Delete(arg0 context.Context, arg1 string) error { } // Delete indicates an expected call of Delete. -func (mr *MockClientMockRecorder) Delete(arg0, arg1 any) *MockClientDeleteCall { +func (mr *MockClientMockRecorder) Delete(arg0, arg1 any) *ClientDeleteCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockClient)(nil).Delete), arg0, arg1) - return &MockClientDeleteCall{Call: call} + return &ClientDeleteCall{Call: call} } -// MockClientDeleteCall wrap *gomock.Call -type MockClientDeleteCall struct { +// ClientDeleteCall wrap *gomock.Call +type ClientDeleteCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockClientDeleteCall) Return(arg0 error) *MockClientDeleteCall { +func (c *ClientDeleteCall) Return(arg0 error) *ClientDeleteCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockClientDeleteCall) Do(f func(context.Context, string) error) *MockClientDeleteCall { +func (c *ClientDeleteCall) Do(f func(context.Context, string) error) *ClientDeleteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockClientDeleteCall) DoAndReturn(f func(context.Context, string) error) *MockClientDeleteCall { +func (c *ClientDeleteCall) DoAndReturn(f func(context.Context, string) error) *ClientDeleteCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -90,31 +89,31 @@ func (m *MockClient) Upload(arg0 context.Context, arg1 io.Reader, arg2 string) ( } // Upload indicates an expected call of Upload. -func (mr *MockClientMockRecorder) Upload(arg0, arg1, arg2 any) *MockClientUploadCall { +func (mr *MockClientMockRecorder) Upload(arg0, arg1, arg2 any) *ClientUploadCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Upload", reflect.TypeOf((*MockClient)(nil).Upload), arg0, arg1, arg2) - return &MockClientUploadCall{Call: call} + return &ClientUploadCall{Call: call} } -// MockClientUploadCall wrap *gomock.Call -type MockClientUploadCall struct { +// ClientUploadCall wrap *gomock.Call +type ClientUploadCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockClientUploadCall) Return(arg0 string, arg1 sftp.AsyncUpload, arg2 error) *MockClientUploadCall { +func (c *ClientUploadCall) Return(arg0 string, arg1 sftp.AsyncUpload, arg2 error) *ClientUploadCall { c.Call = c.Call.Return(arg0, arg1, arg2) return c } // Do rewrite *gomock.Call.Do -func (c *MockClientUploadCall) Do(f func(context.Context, io.Reader, string) (string, sftp.AsyncUpload, error)) *MockClientUploadCall { +func (c *ClientUploadCall) Do(f func(context.Context, io.Reader, string) (string, sftp.AsyncUpload, error)) *ClientUploadCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockClientUploadCall) DoAndReturn(f func(context.Context, io.Reader, string) (string, sftp.AsyncUpload, error)) *MockClientUploadCall { +func (c *ClientUploadCall) DoAndReturn(f func(context.Context, io.Reader, string) (string, sftp.AsyncUpload, error)) *ClientUploadCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -151,31 +150,31 @@ func (m *MockAsyncUpload) Bytes() int64 { } // Bytes indicates an expected call of Bytes. -func (mr *MockAsyncUploadMockRecorder) Bytes() *MockAsyncUploadBytesCall { +func (mr *MockAsyncUploadMockRecorder) Bytes() *AsyncUploadBytesCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Bytes", reflect.TypeOf((*MockAsyncUpload)(nil).Bytes)) - return &MockAsyncUploadBytesCall{Call: call} + return &AsyncUploadBytesCall{Call: call} } -// MockAsyncUploadBytesCall wrap *gomock.Call -type MockAsyncUploadBytesCall struct { +// AsyncUploadBytesCall wrap *gomock.Call +type AsyncUploadBytesCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockAsyncUploadBytesCall) Return(arg0 int64) *MockAsyncUploadBytesCall { +func (c *AsyncUploadBytesCall) Return(arg0 int64) *AsyncUploadBytesCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockAsyncUploadBytesCall) Do(f func() int64) *MockAsyncUploadBytesCall { +func (c *AsyncUploadBytesCall) Do(f func() int64) *AsyncUploadBytesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAsyncUploadBytesCall) DoAndReturn(f func() int64) *MockAsyncUploadBytesCall { +func (c *AsyncUploadBytesCall) DoAndReturn(f func() int64) *AsyncUploadBytesCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -189,31 +188,31 @@ func (m *MockAsyncUpload) Close() error { } // Close indicates an expected call of Close. -func (mr *MockAsyncUploadMockRecorder) Close() *MockAsyncUploadCloseCall { +func (mr *MockAsyncUploadMockRecorder) Close() *AsyncUploadCloseCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockAsyncUpload)(nil).Close)) - return &MockAsyncUploadCloseCall{Call: call} + return &AsyncUploadCloseCall{Call: call} } -// MockAsyncUploadCloseCall wrap *gomock.Call -type MockAsyncUploadCloseCall struct { +// AsyncUploadCloseCall wrap *gomock.Call +type AsyncUploadCloseCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockAsyncUploadCloseCall) Return(arg0 error) *MockAsyncUploadCloseCall { +func (c *AsyncUploadCloseCall) Return(arg0 error) *AsyncUploadCloseCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockAsyncUploadCloseCall) Do(f func() error) *MockAsyncUploadCloseCall { +func (c *AsyncUploadCloseCall) Do(f func() error) *AsyncUploadCloseCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAsyncUploadCloseCall) DoAndReturn(f func() error) *MockAsyncUploadCloseCall { +func (c *AsyncUploadCloseCall) DoAndReturn(f func() error) *AsyncUploadCloseCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -227,31 +226,31 @@ func (m *MockAsyncUpload) Done() chan bool { } // Done indicates an expected call of Done. -func (mr *MockAsyncUploadMockRecorder) Done() *MockAsyncUploadDoneCall { +func (mr *MockAsyncUploadMockRecorder) Done() *AsyncUploadDoneCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Done", reflect.TypeOf((*MockAsyncUpload)(nil).Done)) - return &MockAsyncUploadDoneCall{Call: call} + return &AsyncUploadDoneCall{Call: call} } -// MockAsyncUploadDoneCall wrap *gomock.Call -type MockAsyncUploadDoneCall struct { +// AsyncUploadDoneCall wrap *gomock.Call +type AsyncUploadDoneCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockAsyncUploadDoneCall) Return(arg0 chan bool) *MockAsyncUploadDoneCall { +func (c *AsyncUploadDoneCall) Return(arg0 chan bool) *AsyncUploadDoneCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockAsyncUploadDoneCall) Do(f func() chan bool) *MockAsyncUploadDoneCall { +func (c *AsyncUploadDoneCall) Do(f func() chan bool) *AsyncUploadDoneCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAsyncUploadDoneCall) DoAndReturn(f func() chan bool) *MockAsyncUploadDoneCall { +func (c *AsyncUploadDoneCall) DoAndReturn(f func() chan bool) *AsyncUploadDoneCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -265,31 +264,31 @@ func (m *MockAsyncUpload) Err() chan error { } // Err indicates an expected call of Err. -func (mr *MockAsyncUploadMockRecorder) Err() *MockAsyncUploadErrCall { +func (mr *MockAsyncUploadMockRecorder) Err() *AsyncUploadErrCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Err", reflect.TypeOf((*MockAsyncUpload)(nil).Err)) - return &MockAsyncUploadErrCall{Call: call} + return &AsyncUploadErrCall{Call: call} } -// MockAsyncUploadErrCall wrap *gomock.Call -type MockAsyncUploadErrCall struct { +// AsyncUploadErrCall wrap *gomock.Call +type AsyncUploadErrCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockAsyncUploadErrCall) Return(arg0 chan error) *MockAsyncUploadErrCall { +func (c *AsyncUploadErrCall) Return(arg0 chan error) *AsyncUploadErrCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockAsyncUploadErrCall) Do(f func() chan error) *MockAsyncUploadErrCall { +func (c *AsyncUploadErrCall) Do(f func() chan error) *AsyncUploadErrCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAsyncUploadErrCall) DoAndReturn(f func() chan error) *MockAsyncUploadErrCall { +func (c *AsyncUploadErrCall) DoAndReturn(f func() chan error) *AsyncUploadErrCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -304,31 +303,31 @@ func (m *MockAsyncUpload) Write(arg0 []byte) (int, error) { } // Write indicates an expected call of Write. -func (mr *MockAsyncUploadMockRecorder) Write(arg0 any) *MockAsyncUploadWriteCall { +func (mr *MockAsyncUploadMockRecorder) Write(arg0 any) *AsyncUploadWriteCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockAsyncUpload)(nil).Write), arg0) - return &MockAsyncUploadWriteCall{Call: call} + return &AsyncUploadWriteCall{Call: call} } -// MockAsyncUploadWriteCall wrap *gomock.Call -type MockAsyncUploadWriteCall struct { +// AsyncUploadWriteCall wrap *gomock.Call +type AsyncUploadWriteCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockAsyncUploadWriteCall) Return(arg0 int, arg1 error) *MockAsyncUploadWriteCall { +func (c *AsyncUploadWriteCall) Return(arg0 int, arg1 error) *AsyncUploadWriteCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockAsyncUploadWriteCall) Do(f func([]byte) (int, error)) *MockAsyncUploadWriteCall { +func (c *AsyncUploadWriteCall) Do(f func([]byte) (int, error)) *AsyncUploadWriteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockAsyncUploadWriteCall) DoAndReturn(f func([]byte) (int, error)) *MockAsyncUploadWriteCall { +func (c *AsyncUploadWriteCall) DoAndReturn(f func([]byte) (int, error)) *AsyncUploadWriteCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/internal/storage/fake/mock_storage.go b/internal/storage/fake/mock_storage.go index f55475ca1..25f95ece7 100644 --- a/internal/storage/fake/mock_storage.go +++ b/internal/storage/fake/mock_storage.go @@ -5,7 +5,6 @@ // // mockgen -typed -destination=./internal/storage/fake/mock_storage.go -package=fake github.com/artefactual-sdps/enduro/internal/storage Service // - // Package fake is a generated GoMock package. package fake @@ -54,31 +53,31 @@ func (m *MockService) AddLocation(arg0 context.Context, arg1 *storage.AddLocatio } // AddLocation indicates an expected call of AddLocation. -func (mr *MockServiceMockRecorder) AddLocation(arg0, arg1 any) *MockServiceAddLocationCall { +func (mr *MockServiceMockRecorder) AddLocation(arg0, arg1 any) *ServiceAddLocationCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLocation", reflect.TypeOf((*MockService)(nil).AddLocation), arg0, arg1) - return &MockServiceAddLocationCall{Call: call} + return &ServiceAddLocationCall{Call: call} } -// MockServiceAddLocationCall wrap *gomock.Call -type MockServiceAddLocationCall struct { +// ServiceAddLocationCall wrap *gomock.Call +type ServiceAddLocationCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceAddLocationCall) Return(arg0 *storage.AddLocationResult, arg1 error) *MockServiceAddLocationCall { +func (c *ServiceAddLocationCall) Return(arg0 *storage.AddLocationResult, arg1 error) *ServiceAddLocationCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceAddLocationCall) Do(f func(context.Context, *storage.AddLocationPayload) (*storage.AddLocationResult, error)) *MockServiceAddLocationCall { +func (c *ServiceAddLocationCall) Do(f func(context.Context, *storage.AddLocationPayload) (*storage.AddLocationResult, error)) *ServiceAddLocationCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceAddLocationCall) DoAndReturn(f func(context.Context, *storage.AddLocationPayload) (*storage.AddLocationResult, error)) *MockServiceAddLocationCall { +func (c *ServiceAddLocationCall) DoAndReturn(f func(context.Context, *storage.AddLocationPayload) (*storage.AddLocationResult, error)) *ServiceAddLocationCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -92,31 +91,31 @@ func (m *MockService) Delete(arg0 context.Context, arg1 uuid.UUID) error { } // Delete indicates an expected call of Delete. -func (mr *MockServiceMockRecorder) Delete(arg0, arg1 any) *MockServiceDeleteCall { +func (mr *MockServiceMockRecorder) Delete(arg0, arg1 any) *ServiceDeleteCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockService)(nil).Delete), arg0, arg1) - return &MockServiceDeleteCall{Call: call} + return &ServiceDeleteCall{Call: call} } -// MockServiceDeleteCall wrap *gomock.Call -type MockServiceDeleteCall struct { +// ServiceDeleteCall wrap *gomock.Call +type ServiceDeleteCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceDeleteCall) Return(arg0 error) *MockServiceDeleteCall { +func (c *ServiceDeleteCall) Return(arg0 error) *ServiceDeleteCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceDeleteCall) Do(f func(context.Context, uuid.UUID) error) *MockServiceDeleteCall { +func (c *ServiceDeleteCall) Do(f func(context.Context, uuid.UUID) error) *ServiceDeleteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceDeleteCall) DoAndReturn(f func(context.Context, uuid.UUID) error) *MockServiceDeleteCall { +func (c *ServiceDeleteCall) DoAndReturn(f func(context.Context, uuid.UUID) error) *ServiceDeleteCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -131,31 +130,31 @@ func (m *MockService) Download(arg0 context.Context, arg1 *storage.DownloadPaylo } // Download indicates an expected call of Download. -func (mr *MockServiceMockRecorder) Download(arg0, arg1 any) *MockServiceDownloadCall { +func (mr *MockServiceMockRecorder) Download(arg0, arg1 any) *ServiceDownloadCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Download", reflect.TypeOf((*MockService)(nil).Download), arg0, arg1) - return &MockServiceDownloadCall{Call: call} + return &ServiceDownloadCall{Call: call} } -// MockServiceDownloadCall wrap *gomock.Call -type MockServiceDownloadCall struct { +// ServiceDownloadCall wrap *gomock.Call +type ServiceDownloadCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceDownloadCall) Return(arg0 []byte, arg1 error) *MockServiceDownloadCall { +func (c *ServiceDownloadCall) Return(arg0 []byte, arg1 error) *ServiceDownloadCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceDownloadCall) Do(f func(context.Context, *storage.DownloadPayload) ([]byte, error)) *MockServiceDownloadCall { +func (c *ServiceDownloadCall) Do(f func(context.Context, *storage.DownloadPayload) ([]byte, error)) *ServiceDownloadCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceDownloadCall) DoAndReturn(f func(context.Context, *storage.DownloadPayload) ([]byte, error)) *MockServiceDownloadCall { +func (c *ServiceDownloadCall) DoAndReturn(f func(context.Context, *storage.DownloadPayload) ([]byte, error)) *ServiceDownloadCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -170,31 +169,31 @@ func (m *MockService) Location(arg0 context.Context, arg1 uuid.UUID) (storage0.L } // Location indicates an expected call of Location. -func (mr *MockServiceMockRecorder) Location(arg0, arg1 any) *MockServiceLocationCall { +func (mr *MockServiceMockRecorder) Location(arg0, arg1 any) *ServiceLocationCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Location", reflect.TypeOf((*MockService)(nil).Location), arg0, arg1) - return &MockServiceLocationCall{Call: call} + return &ServiceLocationCall{Call: call} } -// MockServiceLocationCall wrap *gomock.Call -type MockServiceLocationCall struct { +// ServiceLocationCall wrap *gomock.Call +type ServiceLocationCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceLocationCall) Return(arg0 storage0.Location, arg1 error) *MockServiceLocationCall { +func (c *ServiceLocationCall) Return(arg0 storage0.Location, arg1 error) *ServiceLocationCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceLocationCall) Do(f func(context.Context, uuid.UUID) (storage0.Location, error)) *MockServiceLocationCall { +func (c *ServiceLocationCall) Do(f func(context.Context, uuid.UUID) (storage0.Location, error)) *ServiceLocationCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceLocationCall) DoAndReturn(f func(context.Context, uuid.UUID) (storage0.Location, error)) *MockServiceLocationCall { +func (c *ServiceLocationCall) DoAndReturn(f func(context.Context, uuid.UUID) (storage0.Location, error)) *ServiceLocationCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -209,31 +208,31 @@ func (m *MockService) LocationPackages(arg0 context.Context, arg1 *storage.Locat } // LocationPackages indicates an expected call of LocationPackages. -func (mr *MockServiceMockRecorder) LocationPackages(arg0, arg1 any) *MockServiceLocationPackagesCall { +func (mr *MockServiceMockRecorder) LocationPackages(arg0, arg1 any) *ServiceLocationPackagesCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocationPackages", reflect.TypeOf((*MockService)(nil).LocationPackages), arg0, arg1) - return &MockServiceLocationPackagesCall{Call: call} + return &ServiceLocationPackagesCall{Call: call} } -// MockServiceLocationPackagesCall wrap *gomock.Call -type MockServiceLocationPackagesCall struct { +// ServiceLocationPackagesCall wrap *gomock.Call +type ServiceLocationPackagesCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceLocationPackagesCall) Return(arg0 storage.PackageCollection, arg1 error) *MockServiceLocationPackagesCall { +func (c *ServiceLocationPackagesCall) Return(arg0 storage.PackageCollection, arg1 error) *ServiceLocationPackagesCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceLocationPackagesCall) Do(f func(context.Context, *storage.LocationPackagesPayload) (storage.PackageCollection, error)) *MockServiceLocationPackagesCall { +func (c *ServiceLocationPackagesCall) Do(f func(context.Context, *storage.LocationPackagesPayload) (storage.PackageCollection, error)) *ServiceLocationPackagesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceLocationPackagesCall) DoAndReturn(f func(context.Context, *storage.LocationPackagesPayload) (storage.PackageCollection, error)) *MockServiceLocationPackagesCall { +func (c *ServiceLocationPackagesCall) DoAndReturn(f func(context.Context, *storage.LocationPackagesPayload) (storage.PackageCollection, error)) *ServiceLocationPackagesCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -248,31 +247,31 @@ func (m *MockService) Locations(arg0 context.Context, arg1 *storage.LocationsPay } // Locations indicates an expected call of Locations. -func (mr *MockServiceMockRecorder) Locations(arg0, arg1 any) *MockServiceLocationsCall { +func (mr *MockServiceMockRecorder) Locations(arg0, arg1 any) *ServiceLocationsCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Locations", reflect.TypeOf((*MockService)(nil).Locations), arg0, arg1) - return &MockServiceLocationsCall{Call: call} + return &ServiceLocationsCall{Call: call} } -// MockServiceLocationsCall wrap *gomock.Call -type MockServiceLocationsCall struct { +// ServiceLocationsCall wrap *gomock.Call +type ServiceLocationsCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceLocationsCall) Return(arg0 storage.LocationCollection, arg1 error) *MockServiceLocationsCall { +func (c *ServiceLocationsCall) Return(arg0 storage.LocationCollection, arg1 error) *ServiceLocationsCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceLocationsCall) Do(f func(context.Context, *storage.LocationsPayload) (storage.LocationCollection, error)) *MockServiceLocationsCall { +func (c *ServiceLocationsCall) Do(f func(context.Context, *storage.LocationsPayload) (storage.LocationCollection, error)) *ServiceLocationsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceLocationsCall) DoAndReturn(f func(context.Context, *storage.LocationsPayload) (storage.LocationCollection, error)) *MockServiceLocationsCall { +func (c *ServiceLocationsCall) DoAndReturn(f func(context.Context, *storage.LocationsPayload) (storage.LocationCollection, error)) *ServiceLocationsCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -286,31 +285,31 @@ func (m *MockService) Move(arg0 context.Context, arg1 *storage.MovePayload) erro } // Move indicates an expected call of Move. -func (mr *MockServiceMockRecorder) Move(arg0, arg1 any) *MockServiceMoveCall { +func (mr *MockServiceMockRecorder) Move(arg0, arg1 any) *ServiceMoveCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Move", reflect.TypeOf((*MockService)(nil).Move), arg0, arg1) - return &MockServiceMoveCall{Call: call} + return &ServiceMoveCall{Call: call} } -// MockServiceMoveCall wrap *gomock.Call -type MockServiceMoveCall struct { +// ServiceMoveCall wrap *gomock.Call +type ServiceMoveCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceMoveCall) Return(arg0 error) *MockServiceMoveCall { +func (c *ServiceMoveCall) Return(arg0 error) *ServiceMoveCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceMoveCall) Do(f func(context.Context, *storage.MovePayload) error) *MockServiceMoveCall { +func (c *ServiceMoveCall) Do(f func(context.Context, *storage.MovePayload) error) *ServiceMoveCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceMoveCall) DoAndReturn(f func(context.Context, *storage.MovePayload) error) *MockServiceMoveCall { +func (c *ServiceMoveCall) DoAndReturn(f func(context.Context, *storage.MovePayload) error) *ServiceMoveCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -325,31 +324,31 @@ func (m *MockService) MoveStatus(arg0 context.Context, arg1 *storage.MoveStatusP } // MoveStatus indicates an expected call of MoveStatus. -func (mr *MockServiceMockRecorder) MoveStatus(arg0, arg1 any) *MockServiceMoveStatusCall { +func (mr *MockServiceMockRecorder) MoveStatus(arg0, arg1 any) *ServiceMoveStatusCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MoveStatus", reflect.TypeOf((*MockService)(nil).MoveStatus), arg0, arg1) - return &MockServiceMoveStatusCall{Call: call} + return &ServiceMoveStatusCall{Call: call} } -// MockServiceMoveStatusCall wrap *gomock.Call -type MockServiceMoveStatusCall struct { +// ServiceMoveStatusCall wrap *gomock.Call +type ServiceMoveStatusCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceMoveStatusCall) Return(arg0 *storage.MoveStatusResult, arg1 error) *MockServiceMoveStatusCall { +func (c *ServiceMoveStatusCall) Return(arg0 *storage.MoveStatusResult, arg1 error) *ServiceMoveStatusCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceMoveStatusCall) Do(f func(context.Context, *storage.MoveStatusPayload) (*storage.MoveStatusResult, error)) *MockServiceMoveStatusCall { +func (c *ServiceMoveStatusCall) Do(f func(context.Context, *storage.MoveStatusPayload) (*storage.MoveStatusResult, error)) *ServiceMoveStatusCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceMoveStatusCall) DoAndReturn(f func(context.Context, *storage.MoveStatusPayload) (*storage.MoveStatusResult, error)) *MockServiceMoveStatusCall { +func (c *ServiceMoveStatusCall) DoAndReturn(f func(context.Context, *storage.MoveStatusPayload) (*storage.MoveStatusResult, error)) *ServiceMoveStatusCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -364,31 +363,31 @@ func (m *MockService) PackageReader(arg0 context.Context, arg1 *storage.Package) } // PackageReader indicates an expected call of PackageReader. -func (mr *MockServiceMockRecorder) PackageReader(arg0, arg1 any) *MockServicePackageReaderCall { +func (mr *MockServiceMockRecorder) PackageReader(arg0, arg1 any) *ServicePackageReaderCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PackageReader", reflect.TypeOf((*MockService)(nil).PackageReader), arg0, arg1) - return &MockServicePackageReaderCall{Call: call} + return &ServicePackageReaderCall{Call: call} } -// MockServicePackageReaderCall wrap *gomock.Call -type MockServicePackageReaderCall struct { +// ServicePackageReaderCall wrap *gomock.Call +type ServicePackageReaderCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServicePackageReaderCall) Return(arg0 *blob.Reader, arg1 error) *MockServicePackageReaderCall { +func (c *ServicePackageReaderCall) Return(arg0 *blob.Reader, arg1 error) *ServicePackageReaderCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServicePackageReaderCall) Do(f func(context.Context, *storage.Package) (*blob.Reader, error)) *MockServicePackageReaderCall { +func (c *ServicePackageReaderCall) Do(f func(context.Context, *storage.Package) (*blob.Reader, error)) *ServicePackageReaderCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServicePackageReaderCall) DoAndReturn(f func(context.Context, *storage.Package) (*blob.Reader, error)) *MockServicePackageReaderCall { +func (c *ServicePackageReaderCall) DoAndReturn(f func(context.Context, *storage.Package) (*blob.Reader, error)) *ServicePackageReaderCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -403,31 +402,31 @@ func (m *MockService) ReadPackage(arg0 context.Context, arg1 uuid.UUID) (*storag } // ReadPackage indicates an expected call of ReadPackage. -func (mr *MockServiceMockRecorder) ReadPackage(arg0, arg1 any) *MockServiceReadPackageCall { +func (mr *MockServiceMockRecorder) ReadPackage(arg0, arg1 any) *ServiceReadPackageCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadPackage", reflect.TypeOf((*MockService)(nil).ReadPackage), arg0, arg1) - return &MockServiceReadPackageCall{Call: call} + return &ServiceReadPackageCall{Call: call} } -// MockServiceReadPackageCall wrap *gomock.Call -type MockServiceReadPackageCall struct { +// ServiceReadPackageCall wrap *gomock.Call +type ServiceReadPackageCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceReadPackageCall) Return(arg0 *storage.Package, arg1 error) *MockServiceReadPackageCall { +func (c *ServiceReadPackageCall) Return(arg0 *storage.Package, arg1 error) *ServiceReadPackageCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceReadPackageCall) Do(f func(context.Context, uuid.UUID) (*storage.Package, error)) *MockServiceReadPackageCall { +func (c *ServiceReadPackageCall) Do(f func(context.Context, uuid.UUID) (*storage.Package, error)) *ServiceReadPackageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceReadPackageCall) DoAndReturn(f func(context.Context, uuid.UUID) (*storage.Package, error)) *MockServiceReadPackageCall { +func (c *ServiceReadPackageCall) DoAndReturn(f func(context.Context, uuid.UUID) (*storage.Package, error)) *ServiceReadPackageCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -441,31 +440,31 @@ func (m *MockService) Reject(arg0 context.Context, arg1 *storage.RejectPayload) } // Reject indicates an expected call of Reject. -func (mr *MockServiceMockRecorder) Reject(arg0, arg1 any) *MockServiceRejectCall { +func (mr *MockServiceMockRecorder) Reject(arg0, arg1 any) *ServiceRejectCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reject", reflect.TypeOf((*MockService)(nil).Reject), arg0, arg1) - return &MockServiceRejectCall{Call: call} + return &ServiceRejectCall{Call: call} } -// MockServiceRejectCall wrap *gomock.Call -type MockServiceRejectCall struct { +// ServiceRejectCall wrap *gomock.Call +type ServiceRejectCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceRejectCall) Return(arg0 error) *MockServiceRejectCall { +func (c *ServiceRejectCall) Return(arg0 error) *ServiceRejectCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceRejectCall) Do(f func(context.Context, *storage.RejectPayload) error) *MockServiceRejectCall { +func (c *ServiceRejectCall) Do(f func(context.Context, *storage.RejectPayload) error) *ServiceRejectCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceRejectCall) DoAndReturn(f func(context.Context, *storage.RejectPayload) error) *MockServiceRejectCall { +func (c *ServiceRejectCall) DoAndReturn(f func(context.Context, *storage.RejectPayload) error) *ServiceRejectCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -480,31 +479,31 @@ func (m *MockService) Show(arg0 context.Context, arg1 *storage.ShowPayload) (*st } // Show indicates an expected call of Show. -func (mr *MockServiceMockRecorder) Show(arg0, arg1 any) *MockServiceShowCall { +func (mr *MockServiceMockRecorder) Show(arg0, arg1 any) *ServiceShowCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Show", reflect.TypeOf((*MockService)(nil).Show), arg0, arg1) - return &MockServiceShowCall{Call: call} + return &ServiceShowCall{Call: call} } -// MockServiceShowCall wrap *gomock.Call -type MockServiceShowCall struct { +// ServiceShowCall wrap *gomock.Call +type ServiceShowCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceShowCall) Return(arg0 *storage.Package, arg1 error) *MockServiceShowCall { +func (c *ServiceShowCall) Return(arg0 *storage.Package, arg1 error) *ServiceShowCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceShowCall) Do(f func(context.Context, *storage.ShowPayload) (*storage.Package, error)) *MockServiceShowCall { +func (c *ServiceShowCall) Do(f func(context.Context, *storage.ShowPayload) (*storage.Package, error)) *ServiceShowCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceShowCall) DoAndReturn(f func(context.Context, *storage.ShowPayload) (*storage.Package, error)) *MockServiceShowCall { +func (c *ServiceShowCall) DoAndReturn(f func(context.Context, *storage.ShowPayload) (*storage.Package, error)) *ServiceShowCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -519,31 +518,31 @@ func (m *MockService) ShowLocation(arg0 context.Context, arg1 *storage.ShowLocat } // ShowLocation indicates an expected call of ShowLocation. -func (mr *MockServiceMockRecorder) ShowLocation(arg0, arg1 any) *MockServiceShowLocationCall { +func (mr *MockServiceMockRecorder) ShowLocation(arg0, arg1 any) *ServiceShowLocationCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShowLocation", reflect.TypeOf((*MockService)(nil).ShowLocation), arg0, arg1) - return &MockServiceShowLocationCall{Call: call} + return &ServiceShowLocationCall{Call: call} } -// MockServiceShowLocationCall wrap *gomock.Call -type MockServiceShowLocationCall struct { +// ServiceShowLocationCall wrap *gomock.Call +type ServiceShowLocationCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceShowLocationCall) Return(arg0 *storage.Location, arg1 error) *MockServiceShowLocationCall { +func (c *ServiceShowLocationCall) Return(arg0 *storage.Location, arg1 error) *ServiceShowLocationCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceShowLocationCall) Do(f func(context.Context, *storage.ShowLocationPayload) (*storage.Location, error)) *MockServiceShowLocationCall { +func (c *ServiceShowLocationCall) Do(f func(context.Context, *storage.ShowLocationPayload) (*storage.Location, error)) *ServiceShowLocationCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceShowLocationCall) DoAndReturn(f func(context.Context, *storage.ShowLocationPayload) (*storage.Location, error)) *MockServiceShowLocationCall { +func (c *ServiceShowLocationCall) DoAndReturn(f func(context.Context, *storage.ShowLocationPayload) (*storage.Location, error)) *ServiceShowLocationCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -558,31 +557,31 @@ func (m *MockService) Submit(arg0 context.Context, arg1 *storage.SubmitPayload) } // Submit indicates an expected call of Submit. -func (mr *MockServiceMockRecorder) Submit(arg0, arg1 any) *MockServiceSubmitCall { +func (mr *MockServiceMockRecorder) Submit(arg0, arg1 any) *ServiceSubmitCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Submit", reflect.TypeOf((*MockService)(nil).Submit), arg0, arg1) - return &MockServiceSubmitCall{Call: call} + return &ServiceSubmitCall{Call: call} } -// MockServiceSubmitCall wrap *gomock.Call -type MockServiceSubmitCall struct { +// ServiceSubmitCall wrap *gomock.Call +type ServiceSubmitCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceSubmitCall) Return(arg0 *storage.SubmitResult, arg1 error) *MockServiceSubmitCall { +func (c *ServiceSubmitCall) Return(arg0 *storage.SubmitResult, arg1 error) *ServiceSubmitCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceSubmitCall) Do(f func(context.Context, *storage.SubmitPayload) (*storage.SubmitResult, error)) *MockServiceSubmitCall { +func (c *ServiceSubmitCall) Do(f func(context.Context, *storage.SubmitPayload) (*storage.SubmitResult, error)) *ServiceSubmitCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceSubmitCall) DoAndReturn(f func(context.Context, *storage.SubmitPayload) (*storage.SubmitResult, error)) *MockServiceSubmitCall { +func (c *ServiceSubmitCall) DoAndReturn(f func(context.Context, *storage.SubmitPayload) (*storage.SubmitResult, error)) *ServiceSubmitCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -596,31 +595,31 @@ func (m *MockService) Update(arg0 context.Context, arg1 *storage.UpdatePayload) } // Update indicates an expected call of Update. -func (mr *MockServiceMockRecorder) Update(arg0, arg1 any) *MockServiceUpdateCall { +func (mr *MockServiceMockRecorder) Update(arg0, arg1 any) *ServiceUpdateCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockService)(nil).Update), arg0, arg1) - return &MockServiceUpdateCall{Call: call} + return &ServiceUpdateCall{Call: call} } -// MockServiceUpdateCall wrap *gomock.Call -type MockServiceUpdateCall struct { +// ServiceUpdateCall wrap *gomock.Call +type ServiceUpdateCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceUpdateCall) Return(arg0 error) *MockServiceUpdateCall { +func (c *ServiceUpdateCall) Return(arg0 error) *ServiceUpdateCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceUpdateCall) Do(f func(context.Context, *storage.UpdatePayload) error) *MockServiceUpdateCall { +func (c *ServiceUpdateCall) Do(f func(context.Context, *storage.UpdatePayload) error) *ServiceUpdateCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceUpdateCall) DoAndReturn(f func(context.Context, *storage.UpdatePayload) error) *MockServiceUpdateCall { +func (c *ServiceUpdateCall) DoAndReturn(f func(context.Context, *storage.UpdatePayload) error) *ServiceUpdateCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -634,31 +633,31 @@ func (m *MockService) UpdatePackageLocationID(arg0 context.Context, arg1, arg2 u } // UpdatePackageLocationID indicates an expected call of UpdatePackageLocationID. -func (mr *MockServiceMockRecorder) UpdatePackageLocationID(arg0, arg1, arg2 any) *MockServiceUpdatePackageLocationIDCall { +func (mr *MockServiceMockRecorder) UpdatePackageLocationID(arg0, arg1, arg2 any) *ServiceUpdatePackageLocationIDCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePackageLocationID", reflect.TypeOf((*MockService)(nil).UpdatePackageLocationID), arg0, arg1, arg2) - return &MockServiceUpdatePackageLocationIDCall{Call: call} + return &ServiceUpdatePackageLocationIDCall{Call: call} } -// MockServiceUpdatePackageLocationIDCall wrap *gomock.Call -type MockServiceUpdatePackageLocationIDCall struct { +// ServiceUpdatePackageLocationIDCall wrap *gomock.Call +type ServiceUpdatePackageLocationIDCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceUpdatePackageLocationIDCall) Return(arg0 error) *MockServiceUpdatePackageLocationIDCall { +func (c *ServiceUpdatePackageLocationIDCall) Return(arg0 error) *ServiceUpdatePackageLocationIDCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceUpdatePackageLocationIDCall) Do(f func(context.Context, uuid.UUID, uuid.UUID) error) *MockServiceUpdatePackageLocationIDCall { +func (c *ServiceUpdatePackageLocationIDCall) Do(f func(context.Context, uuid.UUID, uuid.UUID) error) *ServiceUpdatePackageLocationIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceUpdatePackageLocationIDCall) DoAndReturn(f func(context.Context, uuid.UUID, uuid.UUID) error) *MockServiceUpdatePackageLocationIDCall { +func (c *ServiceUpdatePackageLocationIDCall) DoAndReturn(f func(context.Context, uuid.UUID, uuid.UUID) error) *ServiceUpdatePackageLocationIDCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -672,31 +671,31 @@ func (m *MockService) UpdatePackageStatus(arg0 context.Context, arg1 uuid.UUID, } // UpdatePackageStatus indicates an expected call of UpdatePackageStatus. -func (mr *MockServiceMockRecorder) UpdatePackageStatus(arg0, arg1, arg2 any) *MockServiceUpdatePackageStatusCall { +func (mr *MockServiceMockRecorder) UpdatePackageStatus(arg0, arg1, arg2 any) *ServiceUpdatePackageStatusCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePackageStatus", reflect.TypeOf((*MockService)(nil).UpdatePackageStatus), arg0, arg1, arg2) - return &MockServiceUpdatePackageStatusCall{Call: call} + return &ServiceUpdatePackageStatusCall{Call: call} } -// MockServiceUpdatePackageStatusCall wrap *gomock.Call -type MockServiceUpdatePackageStatusCall struct { +// ServiceUpdatePackageStatusCall wrap *gomock.Call +type ServiceUpdatePackageStatusCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceUpdatePackageStatusCall) Return(arg0 error) *MockServiceUpdatePackageStatusCall { +func (c *ServiceUpdatePackageStatusCall) Return(arg0 error) *ServiceUpdatePackageStatusCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceUpdatePackageStatusCall) Do(f func(context.Context, uuid.UUID, types.PackageStatus) error) *MockServiceUpdatePackageStatusCall { +func (c *ServiceUpdatePackageStatusCall) Do(f func(context.Context, uuid.UUID, types.PackageStatus) error) *ServiceUpdatePackageStatusCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceUpdatePackageStatusCall) DoAndReturn(f func(context.Context, uuid.UUID, types.PackageStatus) error) *MockServiceUpdatePackageStatusCall { +func (c *ServiceUpdatePackageStatusCall) DoAndReturn(f func(context.Context, uuid.UUID, types.PackageStatus) error) *ServiceUpdatePackageStatusCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/internal/storage/persistence/fake/mock_persistence.go b/internal/storage/persistence/fake/mock_persistence.go index df90ca371..0af9204a5 100644 --- a/internal/storage/persistence/fake/mock_persistence.go +++ b/internal/storage/persistence/fake/mock_persistence.go @@ -5,7 +5,6 @@ // // mockgen -typed -destination=./internal/storage/persistence/fake/mock_persistence.go -package=fake github.com/artefactual-sdps/enduro/internal/storage/persistence Storage // - // Package fake is a generated GoMock package. package fake @@ -52,31 +51,31 @@ func (m *MockStorage) CreateLocation(arg0 context.Context, arg1 *storage.Locatio } // CreateLocation indicates an expected call of CreateLocation. -func (mr *MockStorageMockRecorder) CreateLocation(arg0, arg1, arg2 any) *MockStorageCreateLocationCall { +func (mr *MockStorageMockRecorder) CreateLocation(arg0, arg1, arg2 any) *StorageCreateLocationCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateLocation", reflect.TypeOf((*MockStorage)(nil).CreateLocation), arg0, arg1, arg2) - return &MockStorageCreateLocationCall{Call: call} + return &StorageCreateLocationCall{Call: call} } -// MockStorageCreateLocationCall wrap *gomock.Call -type MockStorageCreateLocationCall struct { +// StorageCreateLocationCall wrap *gomock.Call +type StorageCreateLocationCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockStorageCreateLocationCall) Return(arg0 *storage.Location, arg1 error) *MockStorageCreateLocationCall { +func (c *StorageCreateLocationCall) Return(arg0 *storage.Location, arg1 error) *StorageCreateLocationCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockStorageCreateLocationCall) Do(f func(context.Context, *storage.Location, *types.LocationConfig) (*storage.Location, error)) *MockStorageCreateLocationCall { +func (c *StorageCreateLocationCall) Do(f func(context.Context, *storage.Location, *types.LocationConfig) (*storage.Location, error)) *StorageCreateLocationCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockStorageCreateLocationCall) DoAndReturn(f func(context.Context, *storage.Location, *types.LocationConfig) (*storage.Location, error)) *MockStorageCreateLocationCall { +func (c *StorageCreateLocationCall) DoAndReturn(f func(context.Context, *storage.Location, *types.LocationConfig) (*storage.Location, error)) *StorageCreateLocationCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -91,31 +90,31 @@ func (m *MockStorage) CreatePackage(arg0 context.Context, arg1 *storage.Package) } // CreatePackage indicates an expected call of CreatePackage. -func (mr *MockStorageMockRecorder) CreatePackage(arg0, arg1 any) *MockStorageCreatePackageCall { +func (mr *MockStorageMockRecorder) CreatePackage(arg0, arg1 any) *StorageCreatePackageCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePackage", reflect.TypeOf((*MockStorage)(nil).CreatePackage), arg0, arg1) - return &MockStorageCreatePackageCall{Call: call} + return &StorageCreatePackageCall{Call: call} } -// MockStorageCreatePackageCall wrap *gomock.Call -type MockStorageCreatePackageCall struct { +// StorageCreatePackageCall wrap *gomock.Call +type StorageCreatePackageCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockStorageCreatePackageCall) Return(arg0 *storage.Package, arg1 error) *MockStorageCreatePackageCall { +func (c *StorageCreatePackageCall) Return(arg0 *storage.Package, arg1 error) *StorageCreatePackageCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockStorageCreatePackageCall) Do(f func(context.Context, *storage.Package) (*storage.Package, error)) *MockStorageCreatePackageCall { +func (c *StorageCreatePackageCall) Do(f func(context.Context, *storage.Package) (*storage.Package, error)) *StorageCreatePackageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockStorageCreatePackageCall) DoAndReturn(f func(context.Context, *storage.Package) (*storage.Package, error)) *MockStorageCreatePackageCall { +func (c *StorageCreatePackageCall) DoAndReturn(f func(context.Context, *storage.Package) (*storage.Package, error)) *StorageCreatePackageCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -130,31 +129,31 @@ func (m *MockStorage) ListLocations(arg0 context.Context) (storage.LocationColle } // ListLocations indicates an expected call of ListLocations. -func (mr *MockStorageMockRecorder) ListLocations(arg0 any) *MockStorageListLocationsCall { +func (mr *MockStorageMockRecorder) ListLocations(arg0 any) *StorageListLocationsCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListLocations", reflect.TypeOf((*MockStorage)(nil).ListLocations), arg0) - return &MockStorageListLocationsCall{Call: call} + return &StorageListLocationsCall{Call: call} } -// MockStorageListLocationsCall wrap *gomock.Call -type MockStorageListLocationsCall struct { +// StorageListLocationsCall wrap *gomock.Call +type StorageListLocationsCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockStorageListLocationsCall) Return(arg0 storage.LocationCollection, arg1 error) *MockStorageListLocationsCall { +func (c *StorageListLocationsCall) Return(arg0 storage.LocationCollection, arg1 error) *StorageListLocationsCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockStorageListLocationsCall) Do(f func(context.Context) (storage.LocationCollection, error)) *MockStorageListLocationsCall { +func (c *StorageListLocationsCall) Do(f func(context.Context) (storage.LocationCollection, error)) *StorageListLocationsCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockStorageListLocationsCall) DoAndReturn(f func(context.Context) (storage.LocationCollection, error)) *MockStorageListLocationsCall { +func (c *StorageListLocationsCall) DoAndReturn(f func(context.Context) (storage.LocationCollection, error)) *StorageListLocationsCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -169,31 +168,31 @@ func (m *MockStorage) ListPackages(arg0 context.Context) (storage.PackageCollect } // ListPackages indicates an expected call of ListPackages. -func (mr *MockStorageMockRecorder) ListPackages(arg0 any) *MockStorageListPackagesCall { +func (mr *MockStorageMockRecorder) ListPackages(arg0 any) *StorageListPackagesCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPackages", reflect.TypeOf((*MockStorage)(nil).ListPackages), arg0) - return &MockStorageListPackagesCall{Call: call} + return &StorageListPackagesCall{Call: call} } -// MockStorageListPackagesCall wrap *gomock.Call -type MockStorageListPackagesCall struct { +// StorageListPackagesCall wrap *gomock.Call +type StorageListPackagesCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockStorageListPackagesCall) Return(arg0 storage.PackageCollection, arg1 error) *MockStorageListPackagesCall { +func (c *StorageListPackagesCall) Return(arg0 storage.PackageCollection, arg1 error) *StorageListPackagesCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockStorageListPackagesCall) Do(f func(context.Context) (storage.PackageCollection, error)) *MockStorageListPackagesCall { +func (c *StorageListPackagesCall) Do(f func(context.Context) (storage.PackageCollection, error)) *StorageListPackagesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockStorageListPackagesCall) DoAndReturn(f func(context.Context) (storage.PackageCollection, error)) *MockStorageListPackagesCall { +func (c *StorageListPackagesCall) DoAndReturn(f func(context.Context) (storage.PackageCollection, error)) *StorageListPackagesCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -208,31 +207,31 @@ func (m *MockStorage) LocationPackages(arg0 context.Context, arg1 uuid.UUID) (st } // LocationPackages indicates an expected call of LocationPackages. -func (mr *MockStorageMockRecorder) LocationPackages(arg0, arg1 any) *MockStorageLocationPackagesCall { +func (mr *MockStorageMockRecorder) LocationPackages(arg0, arg1 any) *StorageLocationPackagesCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocationPackages", reflect.TypeOf((*MockStorage)(nil).LocationPackages), arg0, arg1) - return &MockStorageLocationPackagesCall{Call: call} + return &StorageLocationPackagesCall{Call: call} } -// MockStorageLocationPackagesCall wrap *gomock.Call -type MockStorageLocationPackagesCall struct { +// StorageLocationPackagesCall wrap *gomock.Call +type StorageLocationPackagesCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockStorageLocationPackagesCall) Return(arg0 storage.PackageCollection, arg1 error) *MockStorageLocationPackagesCall { +func (c *StorageLocationPackagesCall) Return(arg0 storage.PackageCollection, arg1 error) *StorageLocationPackagesCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockStorageLocationPackagesCall) Do(f func(context.Context, uuid.UUID) (storage.PackageCollection, error)) *MockStorageLocationPackagesCall { +func (c *StorageLocationPackagesCall) Do(f func(context.Context, uuid.UUID) (storage.PackageCollection, error)) *StorageLocationPackagesCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockStorageLocationPackagesCall) DoAndReturn(f func(context.Context, uuid.UUID) (storage.PackageCollection, error)) *MockStorageLocationPackagesCall { +func (c *StorageLocationPackagesCall) DoAndReturn(f func(context.Context, uuid.UUID) (storage.PackageCollection, error)) *StorageLocationPackagesCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -247,31 +246,31 @@ func (m *MockStorage) ReadLocation(arg0 context.Context, arg1 uuid.UUID) (*stora } // ReadLocation indicates an expected call of ReadLocation. -func (mr *MockStorageMockRecorder) ReadLocation(arg0, arg1 any) *MockStorageReadLocationCall { +func (mr *MockStorageMockRecorder) ReadLocation(arg0, arg1 any) *StorageReadLocationCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadLocation", reflect.TypeOf((*MockStorage)(nil).ReadLocation), arg0, arg1) - return &MockStorageReadLocationCall{Call: call} + return &StorageReadLocationCall{Call: call} } -// MockStorageReadLocationCall wrap *gomock.Call -type MockStorageReadLocationCall struct { +// StorageReadLocationCall wrap *gomock.Call +type StorageReadLocationCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockStorageReadLocationCall) Return(arg0 *storage.Location, arg1 error) *MockStorageReadLocationCall { +func (c *StorageReadLocationCall) Return(arg0 *storage.Location, arg1 error) *StorageReadLocationCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockStorageReadLocationCall) Do(f func(context.Context, uuid.UUID) (*storage.Location, error)) *MockStorageReadLocationCall { +func (c *StorageReadLocationCall) Do(f func(context.Context, uuid.UUID) (*storage.Location, error)) *StorageReadLocationCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockStorageReadLocationCall) DoAndReturn(f func(context.Context, uuid.UUID) (*storage.Location, error)) *MockStorageReadLocationCall { +func (c *StorageReadLocationCall) DoAndReturn(f func(context.Context, uuid.UUID) (*storage.Location, error)) *StorageReadLocationCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -286,31 +285,31 @@ func (m *MockStorage) ReadPackage(arg0 context.Context, arg1 uuid.UUID) (*storag } // ReadPackage indicates an expected call of ReadPackage. -func (mr *MockStorageMockRecorder) ReadPackage(arg0, arg1 any) *MockStorageReadPackageCall { +func (mr *MockStorageMockRecorder) ReadPackage(arg0, arg1 any) *StorageReadPackageCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadPackage", reflect.TypeOf((*MockStorage)(nil).ReadPackage), arg0, arg1) - return &MockStorageReadPackageCall{Call: call} + return &StorageReadPackageCall{Call: call} } -// MockStorageReadPackageCall wrap *gomock.Call -type MockStorageReadPackageCall struct { +// StorageReadPackageCall wrap *gomock.Call +type StorageReadPackageCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockStorageReadPackageCall) Return(arg0 *storage.Package, arg1 error) *MockStorageReadPackageCall { +func (c *StorageReadPackageCall) Return(arg0 *storage.Package, arg1 error) *StorageReadPackageCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockStorageReadPackageCall) Do(f func(context.Context, uuid.UUID) (*storage.Package, error)) *MockStorageReadPackageCall { +func (c *StorageReadPackageCall) Do(f func(context.Context, uuid.UUID) (*storage.Package, error)) *StorageReadPackageCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockStorageReadPackageCall) DoAndReturn(f func(context.Context, uuid.UUID) (*storage.Package, error)) *MockStorageReadPackageCall { +func (c *StorageReadPackageCall) DoAndReturn(f func(context.Context, uuid.UUID) (*storage.Package, error)) *StorageReadPackageCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -324,31 +323,31 @@ func (m *MockStorage) UpdatePackageLocationID(arg0 context.Context, arg1, arg2 u } // UpdatePackageLocationID indicates an expected call of UpdatePackageLocationID. -func (mr *MockStorageMockRecorder) UpdatePackageLocationID(arg0, arg1, arg2 any) *MockStorageUpdatePackageLocationIDCall { +func (mr *MockStorageMockRecorder) UpdatePackageLocationID(arg0, arg1, arg2 any) *StorageUpdatePackageLocationIDCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePackageLocationID", reflect.TypeOf((*MockStorage)(nil).UpdatePackageLocationID), arg0, arg1, arg2) - return &MockStorageUpdatePackageLocationIDCall{Call: call} + return &StorageUpdatePackageLocationIDCall{Call: call} } -// MockStorageUpdatePackageLocationIDCall wrap *gomock.Call -type MockStorageUpdatePackageLocationIDCall struct { +// StorageUpdatePackageLocationIDCall wrap *gomock.Call +type StorageUpdatePackageLocationIDCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockStorageUpdatePackageLocationIDCall) Return(arg0 error) *MockStorageUpdatePackageLocationIDCall { +func (c *StorageUpdatePackageLocationIDCall) Return(arg0 error) *StorageUpdatePackageLocationIDCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockStorageUpdatePackageLocationIDCall) Do(f func(context.Context, uuid.UUID, uuid.UUID) error) *MockStorageUpdatePackageLocationIDCall { +func (c *StorageUpdatePackageLocationIDCall) Do(f func(context.Context, uuid.UUID, uuid.UUID) error) *StorageUpdatePackageLocationIDCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockStorageUpdatePackageLocationIDCall) DoAndReturn(f func(context.Context, uuid.UUID, uuid.UUID) error) *MockStorageUpdatePackageLocationIDCall { +func (c *StorageUpdatePackageLocationIDCall) DoAndReturn(f func(context.Context, uuid.UUID, uuid.UUID) error) *StorageUpdatePackageLocationIDCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -362,31 +361,31 @@ func (m *MockStorage) UpdatePackageStatus(arg0 context.Context, arg1 uuid.UUID, } // UpdatePackageStatus indicates an expected call of UpdatePackageStatus. -func (mr *MockStorageMockRecorder) UpdatePackageStatus(arg0, arg1, arg2 any) *MockStorageUpdatePackageStatusCall { +func (mr *MockStorageMockRecorder) UpdatePackageStatus(arg0, arg1, arg2 any) *StorageUpdatePackageStatusCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePackageStatus", reflect.TypeOf((*MockStorage)(nil).UpdatePackageStatus), arg0, arg1, arg2) - return &MockStorageUpdatePackageStatusCall{Call: call} + return &StorageUpdatePackageStatusCall{Call: call} } -// MockStorageUpdatePackageStatusCall wrap *gomock.Call -type MockStorageUpdatePackageStatusCall struct { +// StorageUpdatePackageStatusCall wrap *gomock.Call +type StorageUpdatePackageStatusCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockStorageUpdatePackageStatusCall) Return(arg0 error) *MockStorageUpdatePackageStatusCall { +func (c *StorageUpdatePackageStatusCall) Return(arg0 error) *StorageUpdatePackageStatusCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockStorageUpdatePackageStatusCall) Do(f func(context.Context, uuid.UUID, types.PackageStatus) error) *MockStorageUpdatePackageStatusCall { +func (c *StorageUpdatePackageStatusCall) Do(f func(context.Context, uuid.UUID, types.PackageStatus) error) *StorageUpdatePackageStatusCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockStorageUpdatePackageStatusCall) DoAndReturn(f func(context.Context, uuid.UUID, types.PackageStatus) error) *MockStorageUpdatePackageStatusCall { +func (c *StorageUpdatePackageStatusCall) DoAndReturn(f func(context.Context, uuid.UUID, types.PackageStatus) error) *StorageUpdatePackageStatusCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/internal/upload/fake/mock_upload.go b/internal/upload/fake/mock_upload.go index 7d9c52971..d4276a65f 100644 --- a/internal/upload/fake/mock_upload.go +++ b/internal/upload/fake/mock_upload.go @@ -5,7 +5,6 @@ // // mockgen -typed -destination=./internal/upload/fake/mock_upload.go -package=fake github.com/artefactual-sdps/enduro/internal/upload Service // - // Package fake is a generated GoMock package. package fake @@ -51,31 +50,31 @@ func (m *MockService) Bucket() *blob.Bucket { } // Bucket indicates an expected call of Bucket. -func (mr *MockServiceMockRecorder) Bucket() *MockServiceBucketCall { +func (mr *MockServiceMockRecorder) Bucket() *ServiceBucketCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Bucket", reflect.TypeOf((*MockService)(nil).Bucket)) - return &MockServiceBucketCall{Call: call} + return &ServiceBucketCall{Call: call} } -// MockServiceBucketCall wrap *gomock.Call -type MockServiceBucketCall struct { +// ServiceBucketCall wrap *gomock.Call +type ServiceBucketCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceBucketCall) Return(arg0 *blob.Bucket) *MockServiceBucketCall { +func (c *ServiceBucketCall) Return(arg0 *blob.Bucket) *ServiceBucketCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceBucketCall) Do(f func() *blob.Bucket) *MockServiceBucketCall { +func (c *ServiceBucketCall) Do(f func() *blob.Bucket) *ServiceBucketCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceBucketCall) DoAndReturn(f func() *blob.Bucket) *MockServiceBucketCall { +func (c *ServiceBucketCall) DoAndReturn(f func() *blob.Bucket) *ServiceBucketCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -89,31 +88,31 @@ func (m *MockService) Close() error { } // Close indicates an expected call of Close. -func (mr *MockServiceMockRecorder) Close() *MockServiceCloseCall { +func (mr *MockServiceMockRecorder) Close() *ServiceCloseCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockService)(nil).Close)) - return &MockServiceCloseCall{Call: call} + return &ServiceCloseCall{Call: call} } -// MockServiceCloseCall wrap *gomock.Call -type MockServiceCloseCall struct { +// ServiceCloseCall wrap *gomock.Call +type ServiceCloseCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceCloseCall) Return(arg0 error) *MockServiceCloseCall { +func (c *ServiceCloseCall) Return(arg0 error) *ServiceCloseCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceCloseCall) Do(f func() error) *MockServiceCloseCall { +func (c *ServiceCloseCall) Do(f func() error) *ServiceCloseCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceCloseCall) DoAndReturn(f func() error) *MockServiceCloseCall { +func (c *ServiceCloseCall) DoAndReturn(f func() error) *ServiceCloseCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -127,31 +126,31 @@ func (m *MockService) Upload(arg0 context.Context, arg1 *upload.UploadPayload, a } // Upload indicates an expected call of Upload. -func (mr *MockServiceMockRecorder) Upload(arg0, arg1, arg2 any) *MockServiceUploadCall { +func (mr *MockServiceMockRecorder) Upload(arg0, arg1, arg2 any) *ServiceUploadCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Upload", reflect.TypeOf((*MockService)(nil).Upload), arg0, arg1, arg2) - return &MockServiceUploadCall{Call: call} + return &ServiceUploadCall{Call: call} } -// MockServiceUploadCall wrap *gomock.Call -type MockServiceUploadCall struct { +// ServiceUploadCall wrap *gomock.Call +type ServiceUploadCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceUploadCall) Return(arg0 error) *MockServiceUploadCall { +func (c *ServiceUploadCall) Return(arg0 error) *ServiceUploadCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceUploadCall) Do(f func(context.Context, *upload.UploadPayload, io.ReadCloser) error) *MockServiceUploadCall { +func (c *ServiceUploadCall) Do(f func(context.Context, *upload.UploadPayload, io.ReadCloser) error) *ServiceUploadCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceUploadCall) DoAndReturn(f func(context.Context, *upload.UploadPayload, io.ReadCloser) error) *MockServiceUploadCall { +func (c *ServiceUploadCall) DoAndReturn(f func(context.Context, *upload.UploadPayload, io.ReadCloser) error) *ServiceUploadCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/internal/watcher/fake/mock_service.go b/internal/watcher/fake/mock_service.go index 20dff0fc7..5c28116b7 100644 --- a/internal/watcher/fake/mock_service.go +++ b/internal/watcher/fake/mock_service.go @@ -5,13 +5,11 @@ // // mockgen -typed -destination=./internal/watcher/fake/mock_service.go -package=fake github.com/artefactual-sdps/enduro/internal/watcher Service // - // Package fake is a generated GoMock package. package fake import ( context "context" - io "io" reflect "reflect" watcher "github.com/artefactual-sdps/enduro/internal/watcher" @@ -51,31 +49,31 @@ func (m *MockService) ByName(arg0 string) (watcher.Watcher, error) { } // ByName indicates an expected call of ByName. -func (mr *MockServiceMockRecorder) ByName(arg0 any) *MockServiceByNameCall { +func (mr *MockServiceMockRecorder) ByName(arg0 any) *ServiceByNameCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ByName", reflect.TypeOf((*MockService)(nil).ByName), arg0) - return &MockServiceByNameCall{Call: call} + return &ServiceByNameCall{Call: call} } -// MockServiceByNameCall wrap *gomock.Call -type MockServiceByNameCall struct { +// ServiceByNameCall wrap *gomock.Call +type ServiceByNameCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceByNameCall) Return(arg0 watcher.Watcher, arg1 error) *MockServiceByNameCall { +func (c *ServiceByNameCall) Return(arg0 watcher.Watcher, arg1 error) *ServiceByNameCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceByNameCall) Do(f func(string) (watcher.Watcher, error)) *MockServiceByNameCall { +func (c *ServiceByNameCall) Do(f func(string) (watcher.Watcher, error)) *ServiceByNameCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceByNameCall) DoAndReturn(f func(string) (watcher.Watcher, error)) *MockServiceByNameCall { +func (c *ServiceByNameCall) DoAndReturn(f func(string) (watcher.Watcher, error)) *ServiceByNameCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -89,31 +87,31 @@ func (m *MockService) Delete(arg0 context.Context, arg1, arg2 string) error { } // Delete indicates an expected call of Delete. -func (mr *MockServiceMockRecorder) Delete(arg0, arg1, arg2 any) *MockServiceDeleteCall { +func (mr *MockServiceMockRecorder) Delete(arg0, arg1, arg2 any) *ServiceDeleteCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockService)(nil).Delete), arg0, arg1, arg2) - return &MockServiceDeleteCall{Call: call} + return &ServiceDeleteCall{Call: call} } -// MockServiceDeleteCall wrap *gomock.Call -type MockServiceDeleteCall struct { +// ServiceDeleteCall wrap *gomock.Call +type ServiceDeleteCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceDeleteCall) Return(arg0 error) *MockServiceDeleteCall { +func (c *ServiceDeleteCall) Return(arg0 error) *ServiceDeleteCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceDeleteCall) Do(f func(context.Context, string, string) error) *MockServiceDeleteCall { +func (c *ServiceDeleteCall) Do(f func(context.Context, string, string) error) *ServiceDeleteCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceDeleteCall) DoAndReturn(f func(context.Context, string, string) error) *MockServiceDeleteCall { +func (c *ServiceDeleteCall) DoAndReturn(f func(context.Context, string, string) error) *ServiceDeleteCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -127,37 +125,37 @@ func (m *MockService) Dispose(arg0 context.Context, arg1, arg2 string) error { } // Dispose indicates an expected call of Dispose. -func (mr *MockServiceMockRecorder) Dispose(arg0, arg1, arg2 any) *MockServiceDisposeCall { +func (mr *MockServiceMockRecorder) Dispose(arg0, arg1, arg2 any) *ServiceDisposeCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dispose", reflect.TypeOf((*MockService)(nil).Dispose), arg0, arg1, arg2) - return &MockServiceDisposeCall{Call: call} + return &ServiceDisposeCall{Call: call} } -// MockServiceDisposeCall wrap *gomock.Call -type MockServiceDisposeCall struct { +// ServiceDisposeCall wrap *gomock.Call +type ServiceDisposeCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceDisposeCall) Return(arg0 error) *MockServiceDisposeCall { +func (c *ServiceDisposeCall) Return(arg0 error) *ServiceDisposeCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceDisposeCall) Do(f func(context.Context, string, string) error) *MockServiceDisposeCall { +func (c *ServiceDisposeCall) Do(f func(context.Context, string, string) error) *ServiceDisposeCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceDisposeCall) DoAndReturn(f func(context.Context, string, string) error) *MockServiceDisposeCall { +func (c *ServiceDisposeCall) DoAndReturn(f func(context.Context, string, string) error) *ServiceDisposeCall { c.Call = c.Call.DoAndReturn(f) return c } // Download mocks base method. -func (m *MockService) Download(arg0 context.Context, arg1 io.Writer, arg2, arg3 string) error { +func (m *MockService) Download(arg0 context.Context, arg1, arg2, arg3 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Download", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(error) @@ -165,31 +163,31 @@ func (m *MockService) Download(arg0 context.Context, arg1 io.Writer, arg2, arg3 } // Download indicates an expected call of Download. -func (mr *MockServiceMockRecorder) Download(arg0, arg1, arg2, arg3 any) *MockServiceDownloadCall { +func (mr *MockServiceMockRecorder) Download(arg0, arg1, arg2, arg3 any) *ServiceDownloadCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Download", reflect.TypeOf((*MockService)(nil).Download), arg0, arg1, arg2, arg3) - return &MockServiceDownloadCall{Call: call} + return &ServiceDownloadCall{Call: call} } -// MockServiceDownloadCall wrap *gomock.Call -type MockServiceDownloadCall struct { +// ServiceDownloadCall wrap *gomock.Call +type ServiceDownloadCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceDownloadCall) Return(arg0 error) *MockServiceDownloadCall { +func (c *ServiceDownloadCall) Return(arg0 error) *ServiceDownloadCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceDownloadCall) Do(f func(context.Context, io.Writer, string, string) error) *MockServiceDownloadCall { +func (c *ServiceDownloadCall) Do(f func(context.Context, string, string, string) error) *ServiceDownloadCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceDownloadCall) DoAndReturn(f func(context.Context, io.Writer, string, string) error) *MockServiceDownloadCall { +func (c *ServiceDownloadCall) DoAndReturn(f func(context.Context, string, string, string) error) *ServiceDownloadCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -203,31 +201,31 @@ func (m *MockService) Watchers() []watcher.Watcher { } // Watchers indicates an expected call of Watchers. -func (mr *MockServiceMockRecorder) Watchers() *MockServiceWatchersCall { +func (mr *MockServiceMockRecorder) Watchers() *ServiceWatchersCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Watchers", reflect.TypeOf((*MockService)(nil).Watchers)) - return &MockServiceWatchersCall{Call: call} + return &ServiceWatchersCall{Call: call} } -// MockServiceWatchersCall wrap *gomock.Call -type MockServiceWatchersCall struct { +// ServiceWatchersCall wrap *gomock.Call +type ServiceWatchersCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockServiceWatchersCall) Return(arg0 []watcher.Watcher) *MockServiceWatchersCall { +func (c *ServiceWatchersCall) Return(arg0 []watcher.Watcher) *ServiceWatchersCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockServiceWatchersCall) Do(f func() []watcher.Watcher) *MockServiceWatchersCall { +func (c *ServiceWatchersCall) Do(f func() []watcher.Watcher) *ServiceWatchersCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockServiceWatchersCall) DoAndReturn(f func() []watcher.Watcher) *MockServiceWatchersCall { +func (c *ServiceWatchersCall) DoAndReturn(f func() []watcher.Watcher) *ServiceWatchersCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/internal/watcher/fake/mock_watcher.go b/internal/watcher/fake/mock_watcher.go index 7bdbf07f8..163644b8d 100644 --- a/internal/watcher/fake/mock_watcher.go +++ b/internal/watcher/fake/mock_watcher.go @@ -5,7 +5,6 @@ // // mockgen -typed -destination=./internal/watcher/fake/mock_watcher.go -package=fake github.com/artefactual-sdps/enduro/internal/watcher Watcher // - // Package fake is a generated GoMock package. package fake @@ -51,31 +50,69 @@ func (m *MockWatcher) CompletedDir() string { } // CompletedDir indicates an expected call of CompletedDir. -func (mr *MockWatcherMockRecorder) CompletedDir() *MockWatcherCompletedDirCall { +func (mr *MockWatcherMockRecorder) CompletedDir() *WatcherCompletedDirCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CompletedDir", reflect.TypeOf((*MockWatcher)(nil).CompletedDir)) - return &MockWatcherCompletedDirCall{Call: call} + return &WatcherCompletedDirCall{Call: call} +} + +// WatcherCompletedDirCall wrap *gomock.Call +type WatcherCompletedDirCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *WatcherCompletedDirCall) Return(arg0 string) *WatcherCompletedDirCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *WatcherCompletedDirCall) Do(f func() string) *WatcherCompletedDirCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *WatcherCompletedDirCall) DoAndReturn(f func() string) *WatcherCompletedDirCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// Download mocks base method. +func (m *MockWatcher) Download(arg0 context.Context, arg1, arg2 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Download", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// Download indicates an expected call of Download. +func (mr *MockWatcherMockRecorder) Download(arg0, arg1, arg2 any) *WatcherDownloadCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Download", reflect.TypeOf((*MockWatcher)(nil).Download), arg0, arg1, arg2) + return &WatcherDownloadCall{Call: call} } -// MockWatcherCompletedDirCall wrap *gomock.Call -type MockWatcherCompletedDirCall struct { +// WatcherDownloadCall wrap *gomock.Call +type WatcherDownloadCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockWatcherCompletedDirCall) Return(arg0 string) *MockWatcherCompletedDirCall { +func (c *WatcherDownloadCall) Return(arg0 error) *WatcherDownloadCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockWatcherCompletedDirCall) Do(f func() string) *MockWatcherCompletedDirCall { +func (c *WatcherDownloadCall) Do(f func(context.Context, string, string) error) *WatcherDownloadCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockWatcherCompletedDirCall) DoAndReturn(f func() string) *MockWatcherCompletedDirCall { +func (c *WatcherDownloadCall) DoAndReturn(f func(context.Context, string, string) error) *WatcherDownloadCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -90,31 +127,31 @@ func (m *MockWatcher) OpenBucket(arg0 context.Context) (*blob.Bucket, error) { } // OpenBucket indicates an expected call of OpenBucket. -func (mr *MockWatcherMockRecorder) OpenBucket(arg0 any) *MockWatcherOpenBucketCall { +func (mr *MockWatcherMockRecorder) OpenBucket(arg0 any) *WatcherOpenBucketCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenBucket", reflect.TypeOf((*MockWatcher)(nil).OpenBucket), arg0) - return &MockWatcherOpenBucketCall{Call: call} + return &WatcherOpenBucketCall{Call: call} } -// MockWatcherOpenBucketCall wrap *gomock.Call -type MockWatcherOpenBucketCall struct { +// WatcherOpenBucketCall wrap *gomock.Call +type WatcherOpenBucketCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockWatcherOpenBucketCall) Return(arg0 *blob.Bucket, arg1 error) *MockWatcherOpenBucketCall { +func (c *WatcherOpenBucketCall) Return(arg0 *blob.Bucket, arg1 error) *WatcherOpenBucketCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockWatcherOpenBucketCall) Do(f func(context.Context) (*blob.Bucket, error)) *MockWatcherOpenBucketCall { +func (c *WatcherOpenBucketCall) Do(f func(context.Context) (*blob.Bucket, error)) *WatcherOpenBucketCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockWatcherOpenBucketCall) DoAndReturn(f func(context.Context) (*blob.Bucket, error)) *MockWatcherOpenBucketCall { +func (c *WatcherOpenBucketCall) DoAndReturn(f func(context.Context) (*blob.Bucket, error)) *WatcherOpenBucketCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -128,31 +165,31 @@ func (m *MockWatcher) Path() string { } // Path indicates an expected call of Path. -func (mr *MockWatcherMockRecorder) Path() *MockWatcherPathCall { +func (mr *MockWatcherMockRecorder) Path() *WatcherPathCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Path", reflect.TypeOf((*MockWatcher)(nil).Path)) - return &MockWatcherPathCall{Call: call} + return &WatcherPathCall{Call: call} } -// MockWatcherPathCall wrap *gomock.Call -type MockWatcherPathCall struct { +// WatcherPathCall wrap *gomock.Call +type WatcherPathCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockWatcherPathCall) Return(arg0 string) *MockWatcherPathCall { +func (c *WatcherPathCall) Return(arg0 string) *WatcherPathCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockWatcherPathCall) Do(f func() string) *MockWatcherPathCall { +func (c *WatcherPathCall) Do(f func() string) *WatcherPathCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockWatcherPathCall) DoAndReturn(f func() string) *MockWatcherPathCall { +func (c *WatcherPathCall) DoAndReturn(f func() string) *WatcherPathCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -166,31 +203,31 @@ func (m *MockWatcher) RetentionPeriod() *time.Duration { } // RetentionPeriod indicates an expected call of RetentionPeriod. -func (mr *MockWatcherMockRecorder) RetentionPeriod() *MockWatcherRetentionPeriodCall { +func (mr *MockWatcherMockRecorder) RetentionPeriod() *WatcherRetentionPeriodCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RetentionPeriod", reflect.TypeOf((*MockWatcher)(nil).RetentionPeriod)) - return &MockWatcherRetentionPeriodCall{Call: call} + return &WatcherRetentionPeriodCall{Call: call} } -// MockWatcherRetentionPeriodCall wrap *gomock.Call -type MockWatcherRetentionPeriodCall struct { +// WatcherRetentionPeriodCall wrap *gomock.Call +type WatcherRetentionPeriodCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockWatcherRetentionPeriodCall) Return(arg0 *time.Duration) *MockWatcherRetentionPeriodCall { +func (c *WatcherRetentionPeriodCall) Return(arg0 *time.Duration) *WatcherRetentionPeriodCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockWatcherRetentionPeriodCall) Do(f func() *time.Duration) *MockWatcherRetentionPeriodCall { +func (c *WatcherRetentionPeriodCall) Do(f func() *time.Duration) *WatcherRetentionPeriodCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockWatcherRetentionPeriodCall) DoAndReturn(f func() *time.Duration) *MockWatcherRetentionPeriodCall { +func (c *WatcherRetentionPeriodCall) DoAndReturn(f func() *time.Duration) *WatcherRetentionPeriodCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -204,31 +241,31 @@ func (m *MockWatcher) String() string { } // String indicates an expected call of String. -func (mr *MockWatcherMockRecorder) String() *MockWatcherStringCall { +func (mr *MockWatcherMockRecorder) String() *WatcherStringCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "String", reflect.TypeOf((*MockWatcher)(nil).String)) - return &MockWatcherStringCall{Call: call} + return &WatcherStringCall{Call: call} } -// MockWatcherStringCall wrap *gomock.Call -type MockWatcherStringCall struct { +// WatcherStringCall wrap *gomock.Call +type WatcherStringCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockWatcherStringCall) Return(arg0 string) *MockWatcherStringCall { +func (c *WatcherStringCall) Return(arg0 string) *WatcherStringCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockWatcherStringCall) Do(f func() string) *MockWatcherStringCall { +func (c *WatcherStringCall) Do(f func() string) *WatcherStringCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockWatcherStringCall) DoAndReturn(f func() string) *MockWatcherStringCall { +func (c *WatcherStringCall) DoAndReturn(f func() string) *WatcherStringCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -242,31 +279,31 @@ func (m *MockWatcher) StripTopLevelDir() bool { } // StripTopLevelDir indicates an expected call of StripTopLevelDir. -func (mr *MockWatcherMockRecorder) StripTopLevelDir() *MockWatcherStripTopLevelDirCall { +func (mr *MockWatcherMockRecorder) StripTopLevelDir() *WatcherStripTopLevelDirCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StripTopLevelDir", reflect.TypeOf((*MockWatcher)(nil).StripTopLevelDir)) - return &MockWatcherStripTopLevelDirCall{Call: call} + return &WatcherStripTopLevelDirCall{Call: call} } -// MockWatcherStripTopLevelDirCall wrap *gomock.Call -type MockWatcherStripTopLevelDirCall struct { +// WatcherStripTopLevelDirCall wrap *gomock.Call +type WatcherStripTopLevelDirCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockWatcherStripTopLevelDirCall) Return(arg0 bool) *MockWatcherStripTopLevelDirCall { +func (c *WatcherStripTopLevelDirCall) Return(arg0 bool) *WatcherStripTopLevelDirCall { c.Call = c.Call.Return(arg0) return c } // Do rewrite *gomock.Call.Do -func (c *MockWatcherStripTopLevelDirCall) Do(f func() bool) *MockWatcherStripTopLevelDirCall { +func (c *WatcherStripTopLevelDirCall) Do(f func() bool) *WatcherStripTopLevelDirCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockWatcherStripTopLevelDirCall) DoAndReturn(f func() bool) *MockWatcherStripTopLevelDirCall { +func (c *WatcherStripTopLevelDirCall) DoAndReturn(f func() bool) *WatcherStripTopLevelDirCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -282,31 +319,31 @@ func (m *MockWatcher) Watch(arg0 context.Context) (*watcher.BlobEvent, watcher.C } // Watch indicates an expected call of Watch. -func (mr *MockWatcherMockRecorder) Watch(arg0 any) *MockWatcherWatchCall { +func (mr *MockWatcherMockRecorder) Watch(arg0 any) *WatcherWatchCall { mr.mock.ctrl.T.Helper() call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Watch", reflect.TypeOf((*MockWatcher)(nil).Watch), arg0) - return &MockWatcherWatchCall{Call: call} + return &WatcherWatchCall{Call: call} } -// MockWatcherWatchCall wrap *gomock.Call -type MockWatcherWatchCall struct { +// WatcherWatchCall wrap *gomock.Call +type WatcherWatchCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockWatcherWatchCall) Return(arg0 *watcher.BlobEvent, arg1 watcher.Cleanup, arg2 error) *MockWatcherWatchCall { +func (c *WatcherWatchCall) Return(arg0 *watcher.BlobEvent, arg1 watcher.Cleanup, arg2 error) *WatcherWatchCall { c.Call = c.Call.Return(arg0, arg1, arg2) return c } // Do rewrite *gomock.Call.Do -func (c *MockWatcherWatchCall) Do(f func(context.Context) (*watcher.BlobEvent, watcher.Cleanup, error)) *MockWatcherWatchCall { +func (c *WatcherWatchCall) Do(f func(context.Context) (*watcher.BlobEvent, watcher.Cleanup, error)) *WatcherWatchCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockWatcherWatchCall) DoAndReturn(f func(context.Context) (*watcher.BlobEvent, watcher.Cleanup, error)) *MockWatcherWatchCall { +func (c *WatcherWatchCall) DoAndReturn(f func(context.Context) (*watcher.BlobEvent, watcher.Cleanup, error)) *WatcherWatchCall { c.Call = c.Call.DoAndReturn(f) return c } diff --git a/internal/watcher/filesystem.go b/internal/watcher/filesystem.go index aa8d34696..4a67b6945 100644 --- a/internal/watcher/filesystem.go +++ b/internal/watcher/filesystem.go @@ -15,6 +15,7 @@ import ( "github.com/artefactual-sdps/enduro/internal/filenotify" "github.com/artefactual-sdps/enduro/internal/fsutil" + cp "github.com/otiai10/copy" ) // filesystemWatcher implements a Watcher for watching paths in a local filesystem. @@ -154,3 +155,14 @@ func (w *filesystemWatcher) Dispose(key string) error { return fsutil.Move(src, dst) } + +// Download recursively copies the contents of key to dest. Key may be the name +// of a directory or file. +func (w *filesystemWatcher) Download(ctx context.Context, dest, key string) error { + src := filepath.Clean(filepath.Join(w.path, key)) + if err := cp.Copy(src, dest); err != nil { + return fmt.Errorf("filesystem watcher: download: %v", err) + } + + return nil +} diff --git a/internal/watcher/minio.go b/internal/watcher/minio.go index 9b680a975..a63309a6e 100644 --- a/internal/watcher/minio.go +++ b/internal/watcher/minio.go @@ -5,7 +5,9 @@ import ( "encoding/json" "errors" "fmt" + "io" "net/url" + "os" "time" "github.com/aws/aws-sdk-go/aws/credentials" @@ -157,3 +159,30 @@ func (w *minioWatcher) event(blob string) (*BlobEvent, error) { func (w *minioWatcher) OpenBucket(ctx context.Context) (*blob.Bucket, error) { return s3blob.OpenBucket(ctx, w.sess, w.bucket, nil) } + +// Download copies the contents of the blob identified by key to dest. +func (w *minioWatcher) Download(ctx context.Context, dest, key string) error { + bucket, err := w.OpenBucket(ctx) + if err != nil { + return fmt.Errorf("error opening bucket: %w", err) + } + defer bucket.Close() + + reader, err := bucket.NewReader(ctx, key, nil) + if err != nil { + return fmt.Errorf("error creating reader: %w", err) + } + defer reader.Close() + + writer, err := os.Open(dest) + if err != nil { + return fmt.Errorf("error creating writer: %w", err) + } + defer writer.Close() + + if _, err := io.Copy(writer, reader); err != nil { + return fmt.Errorf("error copying blob: %w", err) + } + + return nil +} diff --git a/internal/watcher/watcher.go b/internal/watcher/watcher.go index 4e986d12b..3f59d6b62 100644 --- a/internal/watcher/watcher.go +++ b/internal/watcher/watcher.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "io" "os" "sync" "time" @@ -31,8 +30,12 @@ type Watcher interface { // Implementors must not return a nil function. Watch(ctx context.Context) (*BlobEvent, Cleanup, error) + // Download copies the file or directory identified by key to dest. + Download(ctx context.Context, dest, key string) error + // OpenBucket returns the bucket where the blobs can be found. OpenBucket(ctx context.Context) (*blob.Bucket, error) + RetentionPeriod() *time.Duration CompletedDir() string StripTopLevelDir() bool @@ -73,8 +76,9 @@ type Service interface { // Return a watcher given its name. ByName(name string) (Watcher, error) - // Download blob given an event. - Download(ctx context.Context, w io.Writer, watcherName, key string) error + // Download copies the watcherName file or directory identified by key to + // dest. + Download(ctx context.Context, dest, watcherName, key string) error // Delete blob given an event. Delete(ctx context.Context, watcherName, key string) error @@ -147,29 +151,13 @@ func (svc *serviceImpl) ByName(name string) (Watcher, error) { return svc.watcher(name) } -func (svc *serviceImpl) Download(ctx context.Context, writer io.Writer, watcherName, key string) error { +func (svc *serviceImpl) Download(ctx context.Context, dest, watcherName, key string) error { w, err := svc.watcher(watcherName) if err != nil { return err } - bucket, err := w.OpenBucket(ctx) - if err != nil { - return fmt.Errorf("error opening bucket: %w", err) - } - defer bucket.Close() - - reader, err := bucket.NewReader(ctx, key, nil) - if err != nil { - return fmt.Errorf("error creating reader: %w", err) - } - defer reader.Close() - - if _, err := io.Copy(writer, reader); err != nil { - return fmt.Errorf("error copying blob: %w", err) - } - - return nil + return w.Download(ctx, dest, key) } func (svc *serviceImpl) Delete(ctx context.Context, watcherName, key string) error { diff --git a/internal/workflow/activities/download.go b/internal/workflow/activities/download.go index dbb6e0584..ce094b950 100644 --- a/internal/workflow/activities/download.go +++ b/internal/workflow/activities/download.go @@ -35,8 +35,6 @@ func NewDownloadActivity(logger logr.Logger, wsvc watcher.Service) *DownloadActi } func (a *DownloadActivity) Execute(ctx context.Context, params *DownloadActivityParams) (*DownloadActivityResult, error) { - var err error - a.logger.V(1).Info("Executing DownloadActivity", "Key", params.Key, "WatcherName", params.WatcherName, @@ -48,14 +46,8 @@ func (a *DownloadActivity) Execute(ctx context.Context, params *DownloadActivity } dest := filepath.Clean(filepath.Join(destDir, params.Key)) - writer, err := os.Create(dest) - if err != nil { - return nil, fmt.Errorf("create file: %v", err) - } - defer writer.Close() //#nosec G307 -- Errors returned by Close() here do not require specific handling. - - if err := a.wsvc.Download(ctx, writer, params.WatcherName, params.Key); err != nil { - return nil, temporal_tools.NewNonRetryableError(fmt.Errorf("download blob: %v", err)) + if err := a.wsvc.Download(ctx, dest, params.WatcherName, params.Key); err != nil { + return nil, temporal_tools.NewNonRetryableError(fmt.Errorf("download: %v", err)) } return &DownloadActivityResult{Path: dest}, nil diff --git a/internal/workflow/activities/download_test.go b/internal/workflow/activities/download_test.go index 4c9f2a781..55b65b1d8 100644 --- a/internal/workflow/activities/download_test.go +++ b/internal/workflow/activities/download_test.go @@ -3,7 +3,6 @@ package activities_test import ( "context" "fmt" - "io" "os" "testing" @@ -20,7 +19,7 @@ import ( ) func TestDownloadActivity(t *testing.T) { - key := "transfer.zip" + key := "jabber.txt" watcherName := "watcher" type test struct { @@ -38,9 +37,15 @@ func TestDownloadActivity(t *testing.T) { WatcherName: watcherName, }, rec: func(r *watcherfake.MockServiceMockRecorder) { - r.Download(mockutil.Context(), gomock.AssignableToTypeOf((*os.File)(nil)), watcherName, key). - DoAndReturn(func(ctx context.Context, w io.Writer, watcherName, key string) error { - _, err := w.Write([]byte("’Twas brillig, and the slithy toves Did gyre and gimble in the wabe:")) + var T string + r.Download(mockutil.Context(), gomock.AssignableToTypeOf(T), watcherName, key). + DoAndReturn(func(ctx context.Context, dest, watcherName, key string) error { + w, err := os.Create(dest) + if err != nil { + return err + } + + _, err = w.Write([]byte("’Twas brillig, and the slithy toves Did gyre and gimble in the wabe:")) return err }) }, @@ -53,11 +58,12 @@ func TestDownloadActivity(t *testing.T) { WatcherName: watcherName, }, rec: func(r *watcherfake.MockServiceMockRecorder) { - r.Download(mockutil.Context(), gomock.AssignableToTypeOf((*os.File)(nil)), watcherName, key).Return( + var T string + r.Download(mockutil.Context(), gomock.AssignableToTypeOf(T), watcherName, key).Return( fmt.Errorf("error loading watcher: unknown watcher %s", watcherName), ) }, - wantErr: fmt.Sprintf("activity error (type: download-activity, scheduledEventID: 0, startedEventID: 0, identity: ): download blob: error loading watcher: unknown watcher %s", watcherName), + wantErr: fmt.Sprintf("activity error (type: download-activity, scheduledEventID: 0, startedEventID: 0, identity: ): download: error loading watcher: unknown watcher %s", watcherName), }, } { t.Run(tt.name, func(t *testing.T) {