diff --git a/go.mod b/go.mod index 4cccd37..b445bf1 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/rs/zerolog v1.33.0 github.com/twmb/go-cache v1.2.1 go.uber.org/goleak v1.3.0 - go.uber.org/mock v0.4.0 + go.uber.org/mock v0.5.0 golang.org/x/sync v0.8.0 golang.org/x/time v0.7.0 golang.org/x/tools v0.26.0 diff --git a/go.sum b/go.sum index 6158681..7417172 100644 --- a/go.sum +++ b/go.sum @@ -478,8 +478,8 @@ go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= -go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= diff --git a/mock_destination_test.go b/mock_destination_test.go index 89471fd..dc27d5b 100644 --- a/mock_destination_test.go +++ b/mock_destination_test.go @@ -4,6 +4,8 @@ // Generated by this command: // // mockgen -typed -destination=mock_destination_test.go -self_package=github.com/conduitio/conduit-connector-sdk -package=sdk -write_package_comment=false . Destination +// + package sdk import ( @@ -19,6 +21,7 @@ import ( type MockDestination struct { ctrl *gomock.Controller recorder *MockDestinationMockRecorder + isgomock struct{} } // MockDestinationMockRecorder is the mock recorder for MockDestination. @@ -77,17 +80,17 @@ func (c *MockDestinationConfigureCall) DoAndReturn(f func(context.Context, confi } // LifecycleOnCreated mocks base method. -func (m *MockDestination) LifecycleOnCreated(arg0 context.Context, arg1 config.Config) error { +func (m *MockDestination) LifecycleOnCreated(ctx context.Context, config config.Config) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LifecycleOnCreated", arg0, arg1) + ret := m.ctrl.Call(m, "LifecycleOnCreated", ctx, config) ret0, _ := ret[0].(error) return ret0 } // LifecycleOnCreated indicates an expected call of LifecycleOnCreated. -func (mr *MockDestinationMockRecorder) LifecycleOnCreated(arg0, arg1 any) *MockDestinationLifecycleOnCreatedCall { +func (mr *MockDestinationMockRecorder) LifecycleOnCreated(ctx, config any) *MockDestinationLifecycleOnCreatedCall { mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnCreated", reflect.TypeOf((*MockDestination)(nil).LifecycleOnCreated), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnCreated", reflect.TypeOf((*MockDestination)(nil).LifecycleOnCreated), ctx, config) return &MockDestinationLifecycleOnCreatedCall{Call: call} } @@ -115,17 +118,17 @@ func (c *MockDestinationLifecycleOnCreatedCall) DoAndReturn(f func(context.Conte } // LifecycleOnDeleted mocks base method. -func (m *MockDestination) LifecycleOnDeleted(arg0 context.Context, arg1 config.Config) error { +func (m *MockDestination) LifecycleOnDeleted(ctx context.Context, config config.Config) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LifecycleOnDeleted", arg0, arg1) + ret := m.ctrl.Call(m, "LifecycleOnDeleted", ctx, config) ret0, _ := ret[0].(error) return ret0 } // LifecycleOnDeleted indicates an expected call of LifecycleOnDeleted. -func (mr *MockDestinationMockRecorder) LifecycleOnDeleted(arg0, arg1 any) *MockDestinationLifecycleOnDeletedCall { +func (mr *MockDestinationMockRecorder) LifecycleOnDeleted(ctx, config any) *MockDestinationLifecycleOnDeletedCall { mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnDeleted", reflect.TypeOf((*MockDestination)(nil).LifecycleOnDeleted), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnDeleted", reflect.TypeOf((*MockDestination)(nil).LifecycleOnDeleted), ctx, config) return &MockDestinationLifecycleOnDeletedCall{Call: call} } @@ -153,17 +156,17 @@ func (c *MockDestinationLifecycleOnDeletedCall) DoAndReturn(f func(context.Conte } // LifecycleOnUpdated mocks base method. -func (m *MockDestination) LifecycleOnUpdated(arg0 context.Context, arg1, arg2 config.Config) error { +func (m *MockDestination) LifecycleOnUpdated(ctx context.Context, configBefore, configAfter config.Config) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LifecycleOnUpdated", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "LifecycleOnUpdated", ctx, configBefore, configAfter) ret0, _ := ret[0].(error) return ret0 } // LifecycleOnUpdated indicates an expected call of LifecycleOnUpdated. -func (mr *MockDestinationMockRecorder) LifecycleOnUpdated(arg0, arg1, arg2 any) *MockDestinationLifecycleOnUpdatedCall { +func (mr *MockDestinationMockRecorder) LifecycleOnUpdated(ctx, configBefore, configAfter any) *MockDestinationLifecycleOnUpdatedCall { mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnUpdated", reflect.TypeOf((*MockDestination)(nil).LifecycleOnUpdated), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnUpdated", reflect.TypeOf((*MockDestination)(nil).LifecycleOnUpdated), ctx, configBefore, configAfter) return &MockDestinationLifecycleOnUpdatedCall{Call: call} } @@ -305,18 +308,18 @@ func (c *MockDestinationTeardownCall) DoAndReturn(f func(context.Context) error) } // Write mocks base method. -func (m *MockDestination) Write(arg0 context.Context, arg1 []opencdc.Record) (int, error) { +func (m *MockDestination) Write(ctx context.Context, r []opencdc.Record) (int, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Write", arg0, arg1) + ret := m.ctrl.Call(m, "Write", ctx, r) ret0, _ := ret[0].(int) ret1, _ := ret[1].(error) return ret0, ret1 } // Write indicates an expected call of Write. -func (mr *MockDestinationMockRecorder) Write(arg0, arg1 any) *MockDestinationWriteCall { +func (mr *MockDestinationMockRecorder) Write(ctx, r any) *MockDestinationWriteCall { mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockDestination)(nil).Write), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockDestination)(nil).Write), ctx, r) return &MockDestinationWriteCall{Call: call} } @@ -326,8 +329,8 @@ type MockDestinationWriteCall struct { } // Return rewrite *gomock.Call.Return -func (c *MockDestinationWriteCall) Return(arg0 int, arg1 error) *MockDestinationWriteCall { - c.Call = c.Call.Return(arg0, arg1) +func (c *MockDestinationWriteCall) Return(n int, err error) *MockDestinationWriteCall { + c.Call = c.Call.Return(n, err) return c } diff --git a/mock_source_test.go b/mock_source_test.go index df95d15..1510f2c 100644 --- a/mock_source_test.go +++ b/mock_source_test.go @@ -4,6 +4,8 @@ // Generated by this command: // // mockgen -typed -destination=mock_source_test.go -self_package=github.com/conduitio/conduit-connector-sdk -package=sdk -write_package_comment=false . Source +// + package sdk import ( @@ -19,6 +21,7 @@ import ( type MockSource struct { ctrl *gomock.Controller recorder *MockSourceMockRecorder + isgomock struct{} } // MockSourceMockRecorder is the mock recorder for MockSource. @@ -115,17 +118,17 @@ func (c *MockSourceConfigureCall) DoAndReturn(f func(context.Context, config.Con } // LifecycleOnCreated mocks base method. -func (m *MockSource) LifecycleOnCreated(arg0 context.Context, arg1 config.Config) error { +func (m *MockSource) LifecycleOnCreated(ctx context.Context, config config.Config) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LifecycleOnCreated", arg0, arg1) + ret := m.ctrl.Call(m, "LifecycleOnCreated", ctx, config) ret0, _ := ret[0].(error) return ret0 } // LifecycleOnCreated indicates an expected call of LifecycleOnCreated. -func (mr *MockSourceMockRecorder) LifecycleOnCreated(arg0, arg1 any) *MockSourceLifecycleOnCreatedCall { +func (mr *MockSourceMockRecorder) LifecycleOnCreated(ctx, config any) *MockSourceLifecycleOnCreatedCall { mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnCreated", reflect.TypeOf((*MockSource)(nil).LifecycleOnCreated), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnCreated", reflect.TypeOf((*MockSource)(nil).LifecycleOnCreated), ctx, config) return &MockSourceLifecycleOnCreatedCall{Call: call} } @@ -153,17 +156,17 @@ func (c *MockSourceLifecycleOnCreatedCall) DoAndReturn(f func(context.Context, c } // LifecycleOnDeleted mocks base method. -func (m *MockSource) LifecycleOnDeleted(arg0 context.Context, arg1 config.Config) error { +func (m *MockSource) LifecycleOnDeleted(ctx context.Context, config config.Config) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LifecycleOnDeleted", arg0, arg1) + ret := m.ctrl.Call(m, "LifecycleOnDeleted", ctx, config) ret0, _ := ret[0].(error) return ret0 } // LifecycleOnDeleted indicates an expected call of LifecycleOnDeleted. -func (mr *MockSourceMockRecorder) LifecycleOnDeleted(arg0, arg1 any) *MockSourceLifecycleOnDeletedCall { +func (mr *MockSourceMockRecorder) LifecycleOnDeleted(ctx, config any) *MockSourceLifecycleOnDeletedCall { mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnDeleted", reflect.TypeOf((*MockSource)(nil).LifecycleOnDeleted), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnDeleted", reflect.TypeOf((*MockSource)(nil).LifecycleOnDeleted), ctx, config) return &MockSourceLifecycleOnDeletedCall{Call: call} } @@ -191,17 +194,17 @@ func (c *MockSourceLifecycleOnDeletedCall) DoAndReturn(f func(context.Context, c } // LifecycleOnUpdated mocks base method. -func (m *MockSource) LifecycleOnUpdated(arg0 context.Context, arg1, arg2 config.Config) error { +func (m *MockSource) LifecycleOnUpdated(ctx context.Context, configBefore, configAfter config.Config) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LifecycleOnUpdated", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "LifecycleOnUpdated", ctx, configBefore, configAfter) ret0, _ := ret[0].(error) return ret0 } // LifecycleOnUpdated indicates an expected call of LifecycleOnUpdated. -func (mr *MockSourceMockRecorder) LifecycleOnUpdated(arg0, arg1, arg2 any) *MockSourceLifecycleOnUpdatedCall { +func (mr *MockSourceMockRecorder) LifecycleOnUpdated(ctx, configBefore, configAfter any) *MockSourceLifecycleOnUpdatedCall { mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnUpdated", reflect.TypeOf((*MockSource)(nil).LifecycleOnUpdated), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LifecycleOnUpdated", reflect.TypeOf((*MockSource)(nil).LifecycleOnUpdated), ctx, configBefore, configAfter) return &MockSourceLifecycleOnUpdatedCall{Call: call} }