From 857a55ee538e6bb91843ad70fdb19a439f5c1f3f Mon Sep 17 00:00:00 2001 From: matoval Date: Thu, 24 Oct 2024 17:45:02 -0700 Subject: [PATCH] Migrate gomock to Uber gomock --- .golangci.yml | 1 - pkg/backends/mock_backends/websockets.go | 187 ++++---- pkg/backends/websockets_test.go | 6 +- pkg/controlsvc/connect_test.go | 2 +- pkg/controlsvc/controlsvc_test.go | 2 +- pkg/controlsvc/mock_controlsvc/controlsvc.go | 124 ++++-- pkg/controlsvc/mock_controlsvc/interfaces.go | 81 ++-- pkg/controlsvc/mock_controlsvc/io.go | 69 +-- pkg/controlsvc/mock_controlsvc/mock_net.go | 56 +-- pkg/controlsvc/ping_test.go | 2 +- pkg/controlsvc/status_test.go | 2 +- pkg/controlsvc/traceroute_test.go | 2 +- pkg/framer/mock_framer/framer.go | 75 ++-- pkg/netceptor/addr_test.go | 2 +- .../mock_netceptor/external_backend.go | 53 ++- pkg/netceptor/mock_netceptor/netceptor.go | 64 +-- pkg/netceptor/mock_netceptor/packetconn.go | 404 +++++++++--------- pkg/netceptor/mock_netceptor/ping.go | 15 +- pkg/netceptor/packetconn_test.go | 2 +- pkg/netceptor/ping_test.go | 2 +- pkg/workceptor/command_test.go | 2 +- pkg/workceptor/kubernetes_test.go | 2 +- .../mock_workceptor/baseworkunit.go | 116 ++--- pkg/workceptor/mock_workceptor/interfaces.go | 280 ++++++------ pkg/workceptor/mock_workceptor/kubernetes.go | 303 ++++++------- pkg/workceptor/mock_workceptor/server.go | 139 ------ pkg/workceptor/mock_workceptor/stdio_utils.go | 163 +++---- pkg/workceptor/mock_workceptor/workceptor.go | 204 +++++++-- .../mock_workceptor/workunitbase.go | 33 +- pkg/workceptor/remote_work_test.go | 2 +- pkg/workceptor/stdio_utils_test.go | 2 +- pkg/workceptor/workceptor_test.go | 2 +- pkg/workceptor/workunitbase_test.go | 2 +- 33 files changed, 1222 insertions(+), 1179 deletions(-) delete mode 100644 pkg/workceptor/mock_workceptor/server.go diff --git a/.golangci.yml b/.golangci.yml index c372e5f9f..22fabb2d6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -86,7 +86,6 @@ linters-settings: - "github.com/fortytw2/leaktest" - "github.com/fsnotify/fsnotify" - "github.com/gorilla/websocket" - - "github.com/golang/mock/gomock" - "github.com/prep/socketpair" - "github.com/google/go-cmp/cmp" - "k8s.io/api/core/v1" diff --git a/pkg/backends/mock_backends/websockets.go b/pkg/backends/mock_backends/websockets.go index 3dc54b9c7..84f6d6576 100644 --- a/pkg/backends/mock_backends/websockets.go +++ b/pkg/backends/mock_backends/websockets.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: pkg/backends/websockets.go +// +// Generated by this command: +// +// mockgen -source=pkg/backends/websockets.go -destination=pkg/backends/mock_backends/websockets.go +// // Package mock_backends is a generated GoMock package. package mock_backends @@ -7,39 +12,41 @@ package mock_backends import ( context "context" tls "crypto/tls" - backends "github.com/ansible/receptor/pkg/backends" - netceptor "github.com/ansible/receptor/pkg/netceptor" - gomock "github.com/golang/mock/gomock" net "net" http "net/http" reflect "reflect" sync "sync" + + backends "github.com/ansible/receptor/pkg/backends" + netceptor "github.com/ansible/receptor/pkg/netceptor" + gomock "go.uber.org/mock/gomock" ) -// MockGorillaWebsocketDialerForDialer is a mock of GorillaWebsocketDialerForDialer interface +// MockGorillaWebsocketDialerForDialer is a mock of GorillaWebsocketDialerForDialer interface. type MockGorillaWebsocketDialerForDialer struct { ctrl *gomock.Controller recorder *MockGorillaWebsocketDialerForDialerMockRecorder + isgomock struct{} } -// MockGorillaWebsocketDialerForDialerMockRecorder is the mock recorder for MockGorillaWebsocketDialerForDialer +// MockGorillaWebsocketDialerForDialerMockRecorder is the mock recorder for MockGorillaWebsocketDialerForDialer. type MockGorillaWebsocketDialerForDialerMockRecorder struct { mock *MockGorillaWebsocketDialerForDialer } -// NewMockGorillaWebsocketDialerForDialer creates a new mock instance +// NewMockGorillaWebsocketDialerForDialer creates a new mock instance. func NewMockGorillaWebsocketDialerForDialer(ctrl *gomock.Controller) *MockGorillaWebsocketDialerForDialer { mock := &MockGorillaWebsocketDialerForDialer{ctrl: ctrl} mock.recorder = &MockGorillaWebsocketDialerForDialerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockGorillaWebsocketDialerForDialer) EXPECT() *MockGorillaWebsocketDialerForDialerMockRecorder { return m.recorder } -// DialContext mocks base method +// DialContext mocks base method. func (m *MockGorillaWebsocketDialerForDialer) DialContext(ctx context.Context, urlStr string, requestHeader http.Header) (backends.Conner, *http.Response, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DialContext", ctx, urlStr, requestHeader) @@ -49,36 +56,37 @@ func (m *MockGorillaWebsocketDialerForDialer) DialContext(ctx context.Context, u return ret0, ret1, ret2 } -// DialContext indicates an expected call of DialContext -func (mr *MockGorillaWebsocketDialerForDialerMockRecorder) DialContext(ctx, urlStr, requestHeader interface{}) *gomock.Call { +// DialContext indicates an expected call of DialContext. +func (mr *MockGorillaWebsocketDialerForDialerMockRecorder) DialContext(ctx, urlStr, requestHeader any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DialContext", reflect.TypeOf((*MockGorillaWebsocketDialerForDialer)(nil).DialContext), ctx, urlStr, requestHeader) } -// MockWebsocketListenerForWebsocket is a mock of WebsocketListenerForWebsocket interface +// MockWebsocketListenerForWebsocket is a mock of WebsocketListenerForWebsocket interface. type MockWebsocketListenerForWebsocket struct { ctrl *gomock.Controller recorder *MockWebsocketListenerForWebsocketMockRecorder + isgomock struct{} } -// MockWebsocketListenerForWebsocketMockRecorder is the mock recorder for MockWebsocketListenerForWebsocket +// MockWebsocketListenerForWebsocketMockRecorder is the mock recorder for MockWebsocketListenerForWebsocket. type MockWebsocketListenerForWebsocketMockRecorder struct { mock *MockWebsocketListenerForWebsocket } -// NewMockWebsocketListenerForWebsocket creates a new mock instance +// NewMockWebsocketListenerForWebsocket creates a new mock instance. func NewMockWebsocketListenerForWebsocket(ctrl *gomock.Controller) *MockWebsocketListenerForWebsocket { mock := &MockWebsocketListenerForWebsocket{ctrl: ctrl} mock.recorder = &MockWebsocketListenerForWebsocketMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockWebsocketListenerForWebsocket) EXPECT() *MockWebsocketListenerForWebsocketMockRecorder { return m.recorder } -// Addr mocks base method +// Addr mocks base method. func (m *MockWebsocketListenerForWebsocket) Addr() net.Addr { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Addr") @@ -86,13 +94,13 @@ func (m *MockWebsocketListenerForWebsocket) Addr() net.Addr { return ret0 } -// Addr indicates an expected call of Addr +// Addr indicates an expected call of Addr. func (mr *MockWebsocketListenerForWebsocketMockRecorder) Addr() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Addr", reflect.TypeOf((*MockWebsocketListenerForWebsocket)(nil).Addr)) } -// GetAddr mocks base method +// GetAddr mocks base method. func (m *MockWebsocketListenerForWebsocket) GetAddr() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAddr") @@ -100,13 +108,13 @@ func (m *MockWebsocketListenerForWebsocket) GetAddr() string { return ret0 } -// GetAddr indicates an expected call of GetAddr +// GetAddr indicates an expected call of GetAddr. func (mr *MockWebsocketListenerForWebsocketMockRecorder) GetAddr() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAddr", reflect.TypeOf((*MockWebsocketListenerForWebsocket)(nil).GetAddr)) } -// GetTLS mocks base method +// GetTLS mocks base method. func (m *MockWebsocketListenerForWebsocket) GetTLS() *tls.Config { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetTLS") @@ -114,13 +122,13 @@ func (m *MockWebsocketListenerForWebsocket) GetTLS() *tls.Config { return ret0 } -// GetTLS indicates an expected call of GetTLS +// GetTLS indicates an expected call of GetTLS. func (mr *MockWebsocketListenerForWebsocketMockRecorder) GetTLS() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTLS", reflect.TypeOf((*MockWebsocketListenerForWebsocket)(nil).GetTLS)) } -// Path mocks base method +// Path mocks base method. func (m *MockWebsocketListenerForWebsocket) Path() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Path") @@ -128,25 +136,25 @@ func (m *MockWebsocketListenerForWebsocket) Path() string { return ret0 } -// Path indicates an expected call of Path +// Path indicates an expected call of Path. func (mr *MockWebsocketListenerForWebsocketMockRecorder) Path() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Path", reflect.TypeOf((*MockWebsocketListenerForWebsocket)(nil).Path)) } -// SetPath mocks base method +// SetPath mocks base method. func (m *MockWebsocketListenerForWebsocket) SetPath(path string) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetPath", path) } -// SetPath indicates an expected call of SetPath -func (mr *MockWebsocketListenerForWebsocketMockRecorder) SetPath(path interface{}) *gomock.Call { +// SetPath indicates an expected call of SetPath. +func (mr *MockWebsocketListenerForWebsocketMockRecorder) SetPath(path any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPath", reflect.TypeOf((*MockWebsocketListenerForWebsocket)(nil).SetPath), path) } -// Start mocks base method +// Start mocks base method. func (m *MockWebsocketListenerForWebsocket) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Start", ctx, wg) @@ -155,36 +163,37 @@ func (m *MockWebsocketListenerForWebsocket) Start(ctx context.Context, wg *sync. return ret0, ret1 } -// Start indicates an expected call of Start -func (mr *MockWebsocketListenerForWebsocketMockRecorder) Start(ctx, wg interface{}) *gomock.Call { +// Start indicates an expected call of Start. +func (mr *MockWebsocketListenerForWebsocketMockRecorder) Start(ctx, wg any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockWebsocketListenerForWebsocket)(nil).Start), ctx, wg) } -// MockGorillaWebsocketUpgraderForListener is a mock of GorillaWebsocketUpgraderForListener interface +// MockGorillaWebsocketUpgraderForListener is a mock of GorillaWebsocketUpgraderForListener interface. type MockGorillaWebsocketUpgraderForListener struct { ctrl *gomock.Controller recorder *MockGorillaWebsocketUpgraderForListenerMockRecorder + isgomock struct{} } -// MockGorillaWebsocketUpgraderForListenerMockRecorder is the mock recorder for MockGorillaWebsocketUpgraderForListener +// MockGorillaWebsocketUpgraderForListenerMockRecorder is the mock recorder for MockGorillaWebsocketUpgraderForListener. type MockGorillaWebsocketUpgraderForListenerMockRecorder struct { mock *MockGorillaWebsocketUpgraderForListener } -// NewMockGorillaWebsocketUpgraderForListener creates a new mock instance +// NewMockGorillaWebsocketUpgraderForListener creates a new mock instance. func NewMockGorillaWebsocketUpgraderForListener(ctrl *gomock.Controller) *MockGorillaWebsocketUpgraderForListener { mock := &MockGorillaWebsocketUpgraderForListener{ctrl: ctrl} mock.recorder = &MockGorillaWebsocketUpgraderForListenerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockGorillaWebsocketUpgraderForListener) EXPECT() *MockGorillaWebsocketUpgraderForListenerMockRecorder { return m.recorder } -// Upgrade mocks base method +// Upgrade mocks base method. func (m *MockGorillaWebsocketUpgraderForListener) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (backends.Conner, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Upgrade", w, r, responseHeader) @@ -193,125 +202,127 @@ func (m *MockGorillaWebsocketUpgraderForListener) Upgrade(w http.ResponseWriter, return ret0, ret1 } -// Upgrade indicates an expected call of Upgrade -func (mr *MockGorillaWebsocketUpgraderForListenerMockRecorder) Upgrade(w, r, responseHeader interface{}) *gomock.Call { +// Upgrade indicates an expected call of Upgrade. +func (mr *MockGorillaWebsocketUpgraderForListenerMockRecorder) Upgrade(w, r, responseHeader any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Upgrade", reflect.TypeOf((*MockGorillaWebsocketUpgraderForListener)(nil).Upgrade), w, r, responseHeader) } -// MockHttpServerForListener is a mock of HttpServerForListener interface -type MockHttpServerForListener struct { +// MockHTTPServerForListener is a mock of HTTPServerForListener interface. +type MockHTTPServerForListener struct { ctrl *gomock.Controller - recorder *MockHttpServerForListenerMockRecorder + recorder *MockHTTPServerForListenerMockRecorder + isgomock struct{} } -// MockHttpServerForListenerMockRecorder is the mock recorder for MockHttpServerForListener -type MockHttpServerForListenerMockRecorder struct { - mock *MockHttpServerForListener +// MockHTTPServerForListenerMockRecorder is the mock recorder for MockHTTPServerForListener. +type MockHTTPServerForListenerMockRecorder struct { + mock *MockHTTPServerForListener } -// NewMockHttpServerForListener creates a new mock instance -func NewMockHttpServerForListener(ctrl *gomock.Controller) *MockHttpServerForListener { - mock := &MockHttpServerForListener{ctrl: ctrl} - mock.recorder = &MockHttpServerForListenerMockRecorder{mock} +// NewMockHTTPServerForListener creates a new mock instance. +func NewMockHTTPServerForListener(ctrl *gomock.Controller) *MockHTTPServerForListener { + mock := &MockHTTPServerForListener{ctrl: ctrl} + mock.recorder = &MockHTTPServerForListenerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockHttpServerForListener) EXPECT() *MockHttpServerForListenerMockRecorder { +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockHTTPServerForListener) EXPECT() *MockHTTPServerForListenerMockRecorder { return m.recorder } -// Serve mocks base method -func (m *MockHttpServerForListener) Serve(l net.Listener) error { +// Close mocks base method. +func (m *MockHTTPServerForListener) Close() error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Serve", l) + ret := m.ctrl.Call(m, "Close") ret0, _ := ret[0].(error) return ret0 } -// Serve indicates an expected call of Serve -func (mr *MockHttpServerForListenerMockRecorder) Serve(l interface{}) *gomock.Call { +// Close indicates an expected call of Close. +func (mr *MockHTTPServerForListenerMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Serve", reflect.TypeOf((*MockHttpServerForListener)(nil).Serve), l) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockHTTPServerForListener)(nil).Close)) } -// ServeTLS mocks base method -func (m *MockHttpServerForListener) ServeTLS(l net.Listener, certFile, keyFile string) error { +// Serve mocks base method. +func (m *MockHTTPServerForListener) Serve(l net.Listener) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ServeTLS", l, certFile, keyFile) + ret := m.ctrl.Call(m, "Serve", l) ret0, _ := ret[0].(error) return ret0 } -// ServeTLS indicates an expected call of ServeTLS -func (mr *MockHttpServerForListenerMockRecorder) ServeTLS(l, certFile, keyFile interface{}) *gomock.Call { +// Serve indicates an expected call of Serve. +func (mr *MockHTTPServerForListenerMockRecorder) Serve(l any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServeTLS", reflect.TypeOf((*MockHttpServerForListener)(nil).ServeTLS), l, certFile, keyFile) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Serve", reflect.TypeOf((*MockHTTPServerForListener)(nil).Serve), l) } -// Close mocks base method -func (m *MockHttpServerForListener) Close() error { +// ServeTLS mocks base method. +func (m *MockHTTPServerForListener) ServeTLS(l net.Listener, certFile, keyFile string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Close") + ret := m.ctrl.Call(m, "ServeTLS", l, certFile, keyFile) ret0, _ := ret[0].(error) return ret0 } -// Close indicates an expected call of Close -func (mr *MockHttpServerForListenerMockRecorder) Close() *gomock.Call { +// ServeTLS indicates an expected call of ServeTLS. +func (mr *MockHTTPServerForListenerMockRecorder) ServeTLS(l, certFile, keyFile any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockHttpServerForListener)(nil).Close)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServeTLS", reflect.TypeOf((*MockHTTPServerForListener)(nil).ServeTLS), l, certFile, keyFile) } -// SetTLSConfig mocks base method -func (m *MockHttpServerForListener) SetTLSConfig(tlscfg *tls.Config) { +// SetHandeler mocks base method. +func (m *MockHTTPServerForListener) SetHandeler(mux *http.ServeMux) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SetTLSConfig", tlscfg) + m.ctrl.Call(m, "SetHandeler", mux) } -// SetTLSConfig indicates an expected call of SetTLSConfig -func (mr *MockHttpServerForListenerMockRecorder) SetTLSConfig(tlscfg interface{}) *gomock.Call { +// SetHandeler indicates an expected call of SetHandeler. +func (mr *MockHTTPServerForListenerMockRecorder) SetHandeler(mux any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTLSConfig", reflect.TypeOf((*MockHttpServerForListener)(nil).SetTLSConfig), tlscfg) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHandeler", reflect.TypeOf((*MockHTTPServerForListener)(nil).SetHandeler), mux) } -// SetHandeler mocks base method -func (m *MockHttpServerForListener) SetHandeler(mux *http.ServeMux) { +// SetTLSConfig mocks base method. +func (m *MockHTTPServerForListener) SetTLSConfig(tlscfg *tls.Config) { m.ctrl.T.Helper() - m.ctrl.Call(m, "SetHandeler", mux) + m.ctrl.Call(m, "SetTLSConfig", tlscfg) } -// SetHandeler indicates an expected call of SetHandeler -func (mr *MockHttpServerForListenerMockRecorder) SetHandeler(mux interface{}) *gomock.Call { +// SetTLSConfig indicates an expected call of SetTLSConfig. +func (mr *MockHTTPServerForListenerMockRecorder) SetTLSConfig(tlscfg any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHandeler", reflect.TypeOf((*MockHttpServerForListener)(nil).SetHandeler), mux) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTLSConfig", reflect.TypeOf((*MockHTTPServerForListener)(nil).SetTLSConfig), tlscfg) } -// MockConner is a mock of Conner interface +// MockConner is a mock of Conner interface. type MockConner struct { ctrl *gomock.Controller recorder *MockConnerMockRecorder + isgomock struct{} } -// MockConnerMockRecorder is the mock recorder for MockConner +// MockConnerMockRecorder is the mock recorder for MockConner. type MockConnerMockRecorder struct { mock *MockConner } -// NewMockConner creates a new mock instance +// NewMockConner creates a new mock instance. func NewMockConner(ctrl *gomock.Controller) *MockConner { mock := &MockConner{ctrl: ctrl} mock.recorder = &MockConnerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockConner) EXPECT() *MockConnerMockRecorder { return m.recorder } -// Close mocks base method +// Close mocks base method. func (m *MockConner) Close() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Close") @@ -319,13 +330,13 @@ func (m *MockConner) Close() error { return ret0 } -// Close indicates an expected call of Close +// Close indicates an expected call of Close. func (mr *MockConnerMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockConner)(nil).Close)) } -// ReadMessage mocks base method +// ReadMessage mocks base method. func (m *MockConner) ReadMessage() (int, []byte, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ReadMessage") @@ -335,13 +346,13 @@ func (m *MockConner) ReadMessage() (int, []byte, error) { return ret0, ret1, ret2 } -// ReadMessage indicates an expected call of ReadMessage +// ReadMessage indicates an expected call of ReadMessage. func (mr *MockConnerMockRecorder) ReadMessage() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadMessage", reflect.TypeOf((*MockConner)(nil).ReadMessage)) } -// WriteMessage mocks base method +// WriteMessage mocks base method. func (m *MockConner) WriteMessage(messageType int, data []byte) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "WriteMessage", messageType, data) @@ -349,8 +360,8 @@ func (m *MockConner) WriteMessage(messageType int, data []byte) error { return ret0 } -// WriteMessage indicates an expected call of WriteMessage -func (mr *MockConnerMockRecorder) WriteMessage(messageType, data interface{}) *gomock.Call { +// WriteMessage indicates an expected call of WriteMessage. +func (mr *MockConnerMockRecorder) WriteMessage(messageType, data any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteMessage", reflect.TypeOf((*MockConner)(nil).WriteMessage), messageType, data) } diff --git a/pkg/backends/websockets_test.go b/pkg/backends/websockets_test.go index 9c4b5efd7..1c0c986e1 100644 --- a/pkg/backends/websockets_test.go +++ b/pkg/backends/websockets_test.go @@ -21,7 +21,7 @@ import ( "github.com/ansible/receptor/pkg/backends" "github.com/ansible/receptor/pkg/backends/mock_backends" "github.com/ansible/receptor/pkg/logger" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) const ( @@ -208,11 +208,11 @@ func TestWebsocketDialerGetTLS(t *testing.T) { } } -func setUpListener(t *testing.T) (*gomock.Controller, *mock_backends.MockGorillaWebsocketUpgraderForListener, *mock_backends.MockHttpServerForListener) { +func setUpListener(t *testing.T) (*gomock.Controller, *mock_backends.MockGorillaWebsocketUpgraderForListener, *mock_backends.MockHTTPServerForListener) { ctrl := gomock.NewController(t) defer ctrl.Finish() mockWebsocketUpgrader := mock_backends.NewMockGorillaWebsocketUpgraderForListener(ctrl) - mockServer := mock_backends.NewMockHttpServerForListener(ctrl) + mockServer := mock_backends.NewMockHTTPServerForListener(ctrl) return ctrl, mockWebsocketUpgrader, mockServer } diff --git a/pkg/controlsvc/connect_test.go b/pkg/controlsvc/connect_test.go index a402864f0..210a176cb 100644 --- a/pkg/controlsvc/connect_test.go +++ b/pkg/controlsvc/connect_test.go @@ -8,7 +8,7 @@ import ( "github.com/ansible/receptor/pkg/controlsvc" "github.com/ansible/receptor/pkg/controlsvc/mock_controlsvc" "github.com/ansible/receptor/pkg/logger" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) func CheckExpectedError(expectedError bool, errorMessage string, t *testing.T, err error) { diff --git a/pkg/controlsvc/controlsvc_test.go b/pkg/controlsvc/controlsvc_test.go index 00f0dc6c5..6deea0f00 100644 --- a/pkg/controlsvc/controlsvc_test.go +++ b/pkg/controlsvc/controlsvc_test.go @@ -12,7 +12,7 @@ import ( "github.com/ansible/receptor/pkg/controlsvc" "github.com/ansible/receptor/pkg/controlsvc/mock_controlsvc" "github.com/ansible/receptor/pkg/logger" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) const ( diff --git a/pkg/controlsvc/mock_controlsvc/controlsvc.go b/pkg/controlsvc/mock_controlsvc/controlsvc.go index 94a1eb2ad..a5d46b2e2 100644 --- a/pkg/controlsvc/mock_controlsvc/controlsvc.go +++ b/pkg/controlsvc/mock_controlsvc/controlsvc.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ansible/receptor/pkg/controlsvc (interfaces: NetceptorForControlsvc,Utiler,Neter,Tlser) +// Source: pkg/controlsvc/controlsvc.go +// +// Generated by this command: +// +// mockgen -source=pkg/controlsvc/controlsvc.go -destination=pkg/controlsvc/mock_controlsvc/controlsvc.go +// // Package mock_controlsvc is a generated GoMock package. package mock_controlsvc @@ -16,13 +21,53 @@ import ( logger "github.com/ansible/receptor/pkg/logger" netceptor "github.com/ansible/receptor/pkg/netceptor" utils "github.com/ansible/receptor/pkg/utils" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) +// MockCopier is a mock of Copier interface. +type MockCopier struct { + ctrl *gomock.Controller + recorder *MockCopierMockRecorder + isgomock struct{} +} + +// MockCopierMockRecorder is the mock recorder for MockCopier. +type MockCopierMockRecorder struct { + mock *MockCopier +} + +// NewMockCopier creates a new mock instance. +func NewMockCopier(ctrl *gomock.Controller) *MockCopier { + mock := &MockCopier{ctrl: ctrl} + mock.recorder = &MockCopierMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockCopier) EXPECT() *MockCopierMockRecorder { + return m.recorder +} + +// Copy mocks base method. +func (m *MockCopier) Copy(dst io.Writer, src io.Reader) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Copy", dst, src) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Copy indicates an expected call of Copy. +func (mr *MockCopierMockRecorder) Copy(dst, src any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Copy", reflect.TypeOf((*MockCopier)(nil).Copy), dst, src) +} + // MockNetceptorForControlsvc is a mock of NetceptorForControlsvc interface. type MockNetceptorForControlsvc struct { ctrl *gomock.Controller recorder *MockNetceptorForControlsvcMockRecorder + isgomock struct{} } // MockNetceptorForControlsvcMockRecorder is the mock recorder for MockNetceptorForControlsvc. @@ -55,33 +100,33 @@ func (mr *MockNetceptorForControlsvcMockRecorder) CancelBackends() *gomock.Call } // Dial mocks base method. -func (m *MockNetceptorForControlsvc) Dial(arg0, arg1 string, arg2 *tls.Config) (*netceptor.Conn, error) { +func (m *MockNetceptorForControlsvc) Dial(node, service string, tlscfg *tls.Config) (*netceptor.Conn, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Dial", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "Dial", node, service, tlscfg) ret0, _ := ret[0].(*netceptor.Conn) ret1, _ := ret[1].(error) return ret0, ret1 } // Dial indicates an expected call of Dial. -func (mr *MockNetceptorForControlsvcMockRecorder) Dial(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockNetceptorForControlsvcMockRecorder) Dial(node, service, tlscfg any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dial", reflect.TypeOf((*MockNetceptorForControlsvc)(nil).Dial), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dial", reflect.TypeOf((*MockNetceptorForControlsvc)(nil).Dial), node, service, tlscfg) } // GetClientTLSConfig mocks base method. -func (m *MockNetceptorForControlsvc) GetClientTLSConfig(arg0, arg1 string, arg2 netceptor.ExpectedHostnameType) (*tls.Config, error) { +func (m *MockNetceptorForControlsvc) GetClientTLSConfig(name, expectedHostName string, expectedHostNameType netceptor.ExpectedHostnameType) (*tls.Config, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetClientTLSConfig", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "GetClientTLSConfig", name, expectedHostName, expectedHostNameType) ret0, _ := ret[0].(*tls.Config) ret1, _ := ret[1].(error) return ret0, ret1 } // GetClientTLSConfig indicates an expected call of GetClientTLSConfig. -func (mr *MockNetceptorForControlsvcMockRecorder) GetClientTLSConfig(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockNetceptorForControlsvcMockRecorder) GetClientTLSConfig(name, expectedHostName, expectedHostNameType any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClientTLSConfig", reflect.TypeOf((*MockNetceptorForControlsvc)(nil).GetClientTLSConfig), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClientTLSConfig", reflect.TypeOf((*MockNetceptorForControlsvc)(nil).GetClientTLSConfig), name, expectedHostName, expectedHostNameType) } // GetLogger mocks base method. @@ -99,18 +144,18 @@ func (mr *MockNetceptorForControlsvcMockRecorder) GetLogger() *gomock.Call { } // ListenAndAdvertise mocks base method. -func (m *MockNetceptorForControlsvc) ListenAndAdvertise(arg0 string, arg1 *tls.Config, arg2 map[string]string) (*netceptor.Listener, error) { +func (m *MockNetceptorForControlsvc) ListenAndAdvertise(service string, tlscfg *tls.Config, tags map[string]string) (*netceptor.Listener, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListenAndAdvertise", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "ListenAndAdvertise", service, tlscfg, tags) ret0, _ := ret[0].(*netceptor.Listener) ret1, _ := ret[1].(error) return ret0, ret1 } // ListenAndAdvertise indicates an expected call of ListenAndAdvertise. -func (mr *MockNetceptorForControlsvcMockRecorder) ListenAndAdvertise(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockNetceptorForControlsvcMockRecorder) ListenAndAdvertise(service, tlscfg, tags any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListenAndAdvertise", reflect.TypeOf((*MockNetceptorForControlsvc)(nil).ListenAndAdvertise), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListenAndAdvertise", reflect.TypeOf((*MockNetceptorForControlsvc)(nil).ListenAndAdvertise), service, tlscfg, tags) } // MaxForwardingHops mocks base method. @@ -142,9 +187,9 @@ func (mr *MockNetceptorForControlsvcMockRecorder) NodeID() *gomock.Call { } // Ping mocks base method. -func (m *MockNetceptorForControlsvc) Ping(arg0 context.Context, arg1 string, arg2 byte) (time.Duration, string, error) { +func (m *MockNetceptorForControlsvc) Ping(ctx context.Context, target string, hopsToLive byte) (time.Duration, string, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Ping", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "Ping", ctx, target, hopsToLive) ret0, _ := ret[0].(time.Duration) ret1, _ := ret[1].(string) ret2, _ := ret[2].(error) @@ -152,9 +197,9 @@ func (m *MockNetceptorForControlsvc) Ping(arg0 context.Context, arg1 string, arg } // Ping indicates an expected call of Ping. -func (mr *MockNetceptorForControlsvcMockRecorder) Ping(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockNetceptorForControlsvcMockRecorder) Ping(ctx, target, hopsToLive any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ping", reflect.TypeOf((*MockNetceptorForControlsvc)(nil).Ping), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ping", reflect.TypeOf((*MockNetceptorForControlsvc)(nil).Ping), ctx, target, hopsToLive) } // Status mocks base method. @@ -172,23 +217,24 @@ func (mr *MockNetceptorForControlsvcMockRecorder) Status() *gomock.Call { } // Traceroute mocks base method. -func (m *MockNetceptorForControlsvc) Traceroute(arg0 context.Context, arg1 string) <-chan *netceptor.TracerouteResult { +func (m *MockNetceptorForControlsvc) Traceroute(ctx context.Context, target string) <-chan *netceptor.TracerouteResult { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Traceroute", arg0, arg1) + ret := m.ctrl.Call(m, "Traceroute", ctx, target) ret0, _ := ret[0].(<-chan *netceptor.TracerouteResult) return ret0 } // Traceroute indicates an expected call of Traceroute. -func (mr *MockNetceptorForControlsvcMockRecorder) Traceroute(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNetceptorForControlsvcMockRecorder) Traceroute(ctx, target any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Traceroute", reflect.TypeOf((*MockNetceptorForControlsvc)(nil).Traceroute), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Traceroute", reflect.TypeOf((*MockNetceptorForControlsvc)(nil).Traceroute), ctx, target) } // MockUtiler is a mock of Utiler interface. type MockUtiler struct { ctrl *gomock.Controller recorder *MockUtilerMockRecorder + isgomock struct{} } // MockUtilerMockRecorder is the mock recorder for MockUtiler. @@ -209,21 +255,21 @@ func (m *MockUtiler) EXPECT() *MockUtilerMockRecorder { } // BridgeConns mocks base method. -func (m *MockUtiler) BridgeConns(arg0 io.ReadWriteCloser, arg1 string, arg2 io.ReadWriteCloser, arg3 string, arg4 *logger.ReceptorLogger) { +func (m *MockUtiler) BridgeConns(c1 io.ReadWriteCloser, c1Name string, c2 io.ReadWriteCloser, c2Name string, logger *logger.ReceptorLogger) { m.ctrl.T.Helper() - m.ctrl.Call(m, "BridgeConns", arg0, arg1, arg2, arg3, arg4) + m.ctrl.Call(m, "BridgeConns", c1, c1Name, c2, c2Name, logger) } // BridgeConns indicates an expected call of BridgeConns. -func (mr *MockUtilerMockRecorder) BridgeConns(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockUtilerMockRecorder) BridgeConns(c1, c1Name, c2, c2Name, logger any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BridgeConns", reflect.TypeOf((*MockUtiler)(nil).BridgeConns), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BridgeConns", reflect.TypeOf((*MockUtiler)(nil).BridgeConns), c1, c1Name, c2, c2Name, logger) } // UnixSocketListen mocks base method. -func (m *MockUtiler) UnixSocketListen(arg0 string, arg1 fs.FileMode) (net.Listener, *utils.FLock, error) { +func (m *MockUtiler) UnixSocketListen(filename string, permissions fs.FileMode) (net.Listener, *utils.FLock, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UnixSocketListen", arg0, arg1) + ret := m.ctrl.Call(m, "UnixSocketListen", filename, permissions) ret0, _ := ret[0].(net.Listener) ret1, _ := ret[1].(*utils.FLock) ret2, _ := ret[2].(error) @@ -231,15 +277,16 @@ func (m *MockUtiler) UnixSocketListen(arg0 string, arg1 fs.FileMode) (net.Listen } // UnixSocketListen indicates an expected call of UnixSocketListen. -func (mr *MockUtilerMockRecorder) UnixSocketListen(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockUtilerMockRecorder) UnixSocketListen(filename, permissions any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnixSocketListen", reflect.TypeOf((*MockUtiler)(nil).UnixSocketListen), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnixSocketListen", reflect.TypeOf((*MockUtiler)(nil).UnixSocketListen), filename, permissions) } // MockNeter is a mock of Neter interface. type MockNeter struct { ctrl *gomock.Controller recorder *MockNeterMockRecorder + isgomock struct{} } // MockNeterMockRecorder is the mock recorder for MockNeter. @@ -260,24 +307,25 @@ func (m *MockNeter) EXPECT() *MockNeterMockRecorder { } // Listen mocks base method. -func (m *MockNeter) Listen(arg0, arg1 string) (net.Listener, error) { +func (m *MockNeter) Listen(network, address string) (net.Listener, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Listen", arg0, arg1) + ret := m.ctrl.Call(m, "Listen", network, address) ret0, _ := ret[0].(net.Listener) ret1, _ := ret[1].(error) return ret0, ret1 } // Listen indicates an expected call of Listen. -func (mr *MockNeterMockRecorder) Listen(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNeterMockRecorder) Listen(network, address any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Listen", reflect.TypeOf((*MockNeter)(nil).Listen), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Listen", reflect.TypeOf((*MockNeter)(nil).Listen), network, address) } // MockTlser is a mock of Tlser interface. type MockTlser struct { ctrl *gomock.Controller recorder *MockTlserMockRecorder + isgomock struct{} } // MockTlserMockRecorder is the mock recorder for MockTlser. @@ -298,15 +346,15 @@ func (m *MockTlser) EXPECT() *MockTlserMockRecorder { } // NewListener mocks base method. -func (m *MockTlser) NewListener(arg0 net.Listener, arg1 *tls.Config) net.Listener { +func (m *MockTlser) NewListener(inner net.Listener, config *tls.Config) net.Listener { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewListener", arg0, arg1) + ret := m.ctrl.Call(m, "NewListener", inner, config) ret0, _ := ret[0].(net.Listener) return ret0 } // NewListener indicates an expected call of NewListener. -func (mr *MockTlserMockRecorder) NewListener(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockTlserMockRecorder) NewListener(inner, config any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewListener", reflect.TypeOf((*MockTlser)(nil).NewListener), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewListener", reflect.TypeOf((*MockTlser)(nil).NewListener), inner, config) } diff --git a/pkg/controlsvc/mock_controlsvc/interfaces.go b/pkg/controlsvc/mock_controlsvc/interfaces.go index c63fded29..8ce371fac 100644 --- a/pkg/controlsvc/mock_controlsvc/interfaces.go +++ b/pkg/controlsvc/mock_controlsvc/interfaces.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ansible/receptor/pkg/controlsvc (interfaces: ControlCommandType,NetceptorForControlCommand,ControlCommand,ControlFuncOperations) +// Source: pkg/controlsvc/interfaces.go +// +// Generated by this command: +// +// mockgen -source=pkg/controlsvc/interfaces.go -destination=pkg/controlsvc/mock_controlsvc/interfaces.go +// // Package mock_controlsvc is a generated GoMock package. package mock_controlsvc @@ -15,13 +20,14 @@ import ( controlsvc "github.com/ansible/receptor/pkg/controlsvc" logger "github.com/ansible/receptor/pkg/logger" netceptor "github.com/ansible/receptor/pkg/netceptor" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockControlCommandType is a mock of ControlCommandType interface. type MockControlCommandType struct { ctrl *gomock.Controller recorder *MockControlCommandTypeMockRecorder + isgomock struct{} } // MockControlCommandTypeMockRecorder is the mock recorder for MockControlCommandType. @@ -42,7 +48,7 @@ func (m *MockControlCommandType) EXPECT() *MockControlCommandTypeMockRecorder { } // InitFromJSON mocks base method. -func (m *MockControlCommandType) InitFromJSON(arg0 map[string]interface{}) (controlsvc.ControlCommand, error) { +func (m *MockControlCommandType) InitFromJSON(arg0 map[string]any) (controlsvc.ControlCommand, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InitFromJSON", arg0) ret0, _ := ret[0].(controlsvc.ControlCommand) @@ -51,7 +57,7 @@ func (m *MockControlCommandType) InitFromJSON(arg0 map[string]interface{}) (cont } // InitFromJSON indicates an expected call of InitFromJSON. -func (mr *MockControlCommandTypeMockRecorder) InitFromJSON(arg0 interface{}) *gomock.Call { +func (mr *MockControlCommandTypeMockRecorder) InitFromJSON(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitFromJSON", reflect.TypeOf((*MockControlCommandType)(nil).InitFromJSON), arg0) } @@ -66,7 +72,7 @@ func (m *MockControlCommandType) InitFromString(arg0 string) (controlsvc.Control } // InitFromString indicates an expected call of InitFromString. -func (mr *MockControlCommandTypeMockRecorder) InitFromString(arg0 interface{}) *gomock.Call { +func (mr *MockControlCommandTypeMockRecorder) InitFromString(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitFromString", reflect.TypeOf((*MockControlCommandType)(nil).InitFromString), arg0) } @@ -75,6 +81,7 @@ func (mr *MockControlCommandTypeMockRecorder) InitFromString(arg0 interface{}) * type MockNetceptorForControlCommand struct { ctrl *gomock.Controller recorder *MockNetceptorForControlCommandMockRecorder + isgomock struct{} } // MockNetceptorForControlCommandMockRecorder is the mock recorder for MockNetceptorForControlCommand. @@ -107,33 +114,33 @@ func (mr *MockNetceptorForControlCommandMockRecorder) CancelBackends() *gomock.C } // Dial mocks base method. -func (m *MockNetceptorForControlCommand) Dial(arg0, arg1 string, arg2 *tls.Config) (*netceptor.Conn, error) { +func (m *MockNetceptorForControlCommand) Dial(node, service string, tlscfg *tls.Config) (*netceptor.Conn, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Dial", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "Dial", node, service, tlscfg) ret0, _ := ret[0].(*netceptor.Conn) ret1, _ := ret[1].(error) return ret0, ret1 } // Dial indicates an expected call of Dial. -func (mr *MockNetceptorForControlCommandMockRecorder) Dial(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockNetceptorForControlCommandMockRecorder) Dial(node, service, tlscfg any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dial", reflect.TypeOf((*MockNetceptorForControlCommand)(nil).Dial), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dial", reflect.TypeOf((*MockNetceptorForControlCommand)(nil).Dial), node, service, tlscfg) } // GetClientTLSConfig mocks base method. -func (m *MockNetceptorForControlCommand) GetClientTLSConfig(arg0, arg1 string, arg2 netceptor.ExpectedHostnameType) (*tls.Config, error) { +func (m *MockNetceptorForControlCommand) GetClientTLSConfig(name, expectedHostName string, expectedHostNameType netceptor.ExpectedHostnameType) (*tls.Config, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetClientTLSConfig", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "GetClientTLSConfig", name, expectedHostName, expectedHostNameType) ret0, _ := ret[0].(*tls.Config) ret1, _ := ret[1].(error) return ret0, ret1 } // GetClientTLSConfig indicates an expected call of GetClientTLSConfig. -func (mr *MockNetceptorForControlCommandMockRecorder) GetClientTLSConfig(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockNetceptorForControlCommandMockRecorder) GetClientTLSConfig(name, expectedHostName, expectedHostNameType any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClientTLSConfig", reflect.TypeOf((*MockNetceptorForControlCommand)(nil).GetClientTLSConfig), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClientTLSConfig", reflect.TypeOf((*MockNetceptorForControlCommand)(nil).GetClientTLSConfig), name, expectedHostName, expectedHostNameType) } // GetLogger mocks base method. @@ -179,9 +186,9 @@ func (mr *MockNetceptorForControlCommandMockRecorder) NodeID() *gomock.Call { } // Ping mocks base method. -func (m *MockNetceptorForControlCommand) Ping(arg0 context.Context, arg1 string, arg2 byte) (time.Duration, string, error) { +func (m *MockNetceptorForControlCommand) Ping(ctx context.Context, target string, hopsToLive byte) (time.Duration, string, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Ping", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "Ping", ctx, target, hopsToLive) ret0, _ := ret[0].(time.Duration) ret1, _ := ret[1].(string) ret2, _ := ret[2].(error) @@ -189,9 +196,9 @@ func (m *MockNetceptorForControlCommand) Ping(arg0 context.Context, arg1 string, } // Ping indicates an expected call of Ping. -func (mr *MockNetceptorForControlCommandMockRecorder) Ping(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockNetceptorForControlCommandMockRecorder) Ping(ctx, target, hopsToLive any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ping", reflect.TypeOf((*MockNetceptorForControlCommand)(nil).Ping), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ping", reflect.TypeOf((*MockNetceptorForControlCommand)(nil).Ping), ctx, target, hopsToLive) } // Status mocks base method. @@ -209,23 +216,24 @@ func (mr *MockNetceptorForControlCommandMockRecorder) Status() *gomock.Call { } // Traceroute mocks base method. -func (m *MockNetceptorForControlCommand) Traceroute(arg0 context.Context, arg1 string) <-chan *netceptor.TracerouteResult { +func (m *MockNetceptorForControlCommand) Traceroute(ctx context.Context, target string) <-chan *netceptor.TracerouteResult { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Traceroute", arg0, arg1) + ret := m.ctrl.Call(m, "Traceroute", ctx, target) ret0, _ := ret[0].(<-chan *netceptor.TracerouteResult) return ret0 } // Traceroute indicates an expected call of Traceroute. -func (mr *MockNetceptorForControlCommandMockRecorder) Traceroute(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockNetceptorForControlCommandMockRecorder) Traceroute(ctx, target any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Traceroute", reflect.TypeOf((*MockNetceptorForControlCommand)(nil).Traceroute), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Traceroute", reflect.TypeOf((*MockNetceptorForControlCommand)(nil).Traceroute), ctx, target) } // MockControlCommand is a mock of ControlCommand interface. type MockControlCommand struct { ctrl *gomock.Controller recorder *MockControlCommandMockRecorder + isgomock struct{} } // MockControlCommandMockRecorder is the mock recorder for MockControlCommand. @@ -246,16 +254,16 @@ func (m *MockControlCommand) EXPECT() *MockControlCommandMockRecorder { } // ControlFunc mocks base method. -func (m *MockControlCommand) ControlFunc(arg0 context.Context, arg1 controlsvc.NetceptorForControlCommand, arg2 controlsvc.ControlFuncOperations) (map[string]interface{}, error) { +func (m *MockControlCommand) ControlFunc(arg0 context.Context, arg1 controlsvc.NetceptorForControlCommand, arg2 controlsvc.ControlFuncOperations) (map[string]any, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ControlFunc", arg0, arg1, arg2) - ret0, _ := ret[0].(map[string]interface{}) + ret0, _ := ret[0].(map[string]any) ret1, _ := ret[1].(error) return ret0, ret1 } // ControlFunc indicates an expected call of ControlFunc. -func (mr *MockControlCommandMockRecorder) ControlFunc(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockControlCommandMockRecorder) ControlFunc(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ControlFunc", reflect.TypeOf((*MockControlCommand)(nil).ControlFunc), arg0, arg1, arg2) } @@ -264,6 +272,7 @@ func (mr *MockControlCommandMockRecorder) ControlFunc(arg0, arg1, arg2 interface type MockControlFuncOperations struct { ctrl *gomock.Controller recorder *MockControlFuncOperationsMockRecorder + isgomock struct{} } // MockControlFuncOperationsMockRecorder is the mock recorder for MockControlFuncOperations. @@ -284,17 +293,17 @@ func (m *MockControlFuncOperations) EXPECT() *MockControlFuncOperationsMockRecor } // BridgeConn mocks base method. -func (m *MockControlFuncOperations) BridgeConn(arg0 string, arg1 io.ReadWriteCloser, arg2 string, arg3 *logger.ReceptorLogger, arg4 controlsvc.Utiler) error { +func (m *MockControlFuncOperations) BridgeConn(message string, bc io.ReadWriteCloser, bcName string, logger *logger.ReceptorLogger, utils controlsvc.Utiler) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BridgeConn", arg0, arg1, arg2, arg3, arg4) + ret := m.ctrl.Call(m, "BridgeConn", message, bc, bcName, logger, utils) ret0, _ := ret[0].(error) return ret0 } // BridgeConn indicates an expected call of BridgeConn. -func (mr *MockControlFuncOperationsMockRecorder) BridgeConn(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockControlFuncOperationsMockRecorder) BridgeConn(message, bc, bcName, logger, utils any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BridgeConn", reflect.TypeOf((*MockControlFuncOperations)(nil).BridgeConn), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BridgeConn", reflect.TypeOf((*MockControlFuncOperations)(nil).BridgeConn), message, bc, bcName, logger, utils) } // Close mocks base method. @@ -312,17 +321,17 @@ func (mr *MockControlFuncOperationsMockRecorder) Close() *gomock.Call { } // ReadFromConn mocks base method. -func (m *MockControlFuncOperations) ReadFromConn(arg0 string, arg1 io.Writer, arg2 controlsvc.Copier) error { +func (m *MockControlFuncOperations) ReadFromConn(message string, out io.Writer, io controlsvc.Copier) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ReadFromConn", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "ReadFromConn", message, out, io) ret0, _ := ret[0].(error) return ret0 } // ReadFromConn indicates an expected call of ReadFromConn. -func (mr *MockControlFuncOperationsMockRecorder) ReadFromConn(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockControlFuncOperationsMockRecorder) ReadFromConn(message, out, io any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadFromConn", reflect.TypeOf((*MockControlFuncOperations)(nil).ReadFromConn), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadFromConn", reflect.TypeOf((*MockControlFuncOperations)(nil).ReadFromConn), message, out, io) } // RemoteAddr mocks base method. @@ -340,15 +349,15 @@ func (mr *MockControlFuncOperationsMockRecorder) RemoteAddr() *gomock.Call { } // WriteToConn mocks base method. -func (m *MockControlFuncOperations) WriteToConn(arg0 string, arg1 chan []byte) error { +func (m *MockControlFuncOperations) WriteToConn(message string, in chan []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WriteToConn", arg0, arg1) + ret := m.ctrl.Call(m, "WriteToConn", message, in) ret0, _ := ret[0].(error) return ret0 } // WriteToConn indicates an expected call of WriteToConn. -func (mr *MockControlFuncOperationsMockRecorder) WriteToConn(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockControlFuncOperationsMockRecorder) WriteToConn(message, in any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteToConn", reflect.TypeOf((*MockControlFuncOperations)(nil).WriteToConn), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteToConn", reflect.TypeOf((*MockControlFuncOperations)(nil).WriteToConn), message, in) } diff --git a/pkg/controlsvc/mock_controlsvc/io.go b/pkg/controlsvc/mock_controlsvc/io.go index 338392f59..7b929e88a 100644 --- a/pkg/controlsvc/mock_controlsvc/io.go +++ b/pkg/controlsvc/mock_controlsvc/io.go @@ -1,20 +1,25 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ansible/receptor/pkg/controlsvc (interfaces: ReadWriteCloser,Copier) - -// Package mock_controlsvc is a generated GoMock package. +// Source: io (interfaces: ReadWriteCloser) +// +// Generated by this command: +// +// mockgen io ReadWriteCloser +// + +// Package mock_io is a generated GoMock package. package mock_controlsvc import ( - io "io" reflect "reflect" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockReadWriteCloser is a mock of ReadWriteCloser interface. type MockReadWriteCloser struct { ctrl *gomock.Controller recorder *MockReadWriteCloserMockRecorder + isgomock struct{} } // MockReadWriteCloserMockRecorder is the mock recorder for MockReadWriteCloser. @@ -49,69 +54,31 @@ func (mr *MockReadWriteCloserMockRecorder) Close() *gomock.Call { } // Read mocks base method. -func (m *MockReadWriteCloser) Read(arg0 []byte) (int, error) { +func (m *MockReadWriteCloser) Read(p []byte) (int, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Read", arg0) + ret := m.ctrl.Call(m, "Read", p) ret0, _ := ret[0].(int) ret1, _ := ret[1].(error) return ret0, ret1 } // Read indicates an expected call of Read. -func (mr *MockReadWriteCloserMockRecorder) Read(arg0 interface{}) *gomock.Call { +func (mr *MockReadWriteCloserMockRecorder) Read(p any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockReadWriteCloser)(nil).Read), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockReadWriteCloser)(nil).Read), p) } // Write mocks base method. -func (m *MockReadWriteCloser) Write(arg0 []byte) (int, error) { +func (m *MockReadWriteCloser) Write(p []byte) (int, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Write", arg0) + ret := m.ctrl.Call(m, "Write", p) ret0, _ := ret[0].(int) ret1, _ := ret[1].(error) return ret0, ret1 } // Write indicates an expected call of Write. -func (mr *MockReadWriteCloserMockRecorder) Write(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockReadWriteCloser)(nil).Write), arg0) -} - -// MockCopier is a mock of Copier interface. -type MockCopier struct { - ctrl *gomock.Controller - recorder *MockCopierMockRecorder -} - -// MockCopierMockRecorder is the mock recorder for MockCopier. -type MockCopierMockRecorder struct { - mock *MockCopier -} - -// NewMockCopier creates a new mock instance. -func NewMockCopier(ctrl *gomock.Controller) *MockCopier { - mock := &MockCopier{ctrl: ctrl} - mock.recorder = &MockCopierMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockCopier) EXPECT() *MockCopierMockRecorder { - return m.recorder -} - -// Copy mocks base method. -func (m *MockCopier) Copy(arg0 io.Writer, arg1 io.Reader) (int64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Copy", arg0, arg1) - ret0, _ := ret[0].(int64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Copy indicates an expected call of Copy. -func (mr *MockCopierMockRecorder) Copy(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockReadWriteCloserMockRecorder) Write(p any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Copy", reflect.TypeOf((*MockCopier)(nil).Copy), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockReadWriteCloser)(nil).Write), p) } diff --git a/pkg/controlsvc/mock_controlsvc/mock_net.go b/pkg/controlsvc/mock_controlsvc/mock_net.go index 0876cc053..cd69d03ba 100644 --- a/pkg/controlsvc/mock_controlsvc/mock_net.go +++ b/pkg/controlsvc/mock_controlsvc/mock_net.go @@ -1,7 +1,12 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ansible/receptor/pkg/controlsvc (interfaces: Listener,Conn,Addr) - -// Package mock_controlsvc is a generated GoMock package. +// Source: net (interfaces: Listener,Conn,Addr) +// +// Generated by this command: +// +// mockgen net Listener,Conn,Addr +// + +// Package mock_net is a generated GoMock package. package mock_controlsvc import ( @@ -9,13 +14,14 @@ import ( reflect "reflect" time "time" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockListener is a mock of Listener interface. type MockListener struct { ctrl *gomock.Controller recorder *MockListenerMockRecorder + isgomock struct{} } // MockListenerMockRecorder is the mock recorder for MockListener. @@ -82,6 +88,7 @@ func (mr *MockListenerMockRecorder) Close() *gomock.Call { type MockConn struct { ctrl *gomock.Controller recorder *MockConnMockRecorder + isgomock struct{} } // MockConnMockRecorder is the mock recorder for MockConn. @@ -130,18 +137,18 @@ func (mr *MockConnMockRecorder) LocalAddr() *gomock.Call { } // Read mocks base method. -func (m *MockConn) Read(arg0 []byte) (int, error) { +func (m *MockConn) Read(b []byte) (int, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Read", arg0) + ret := m.ctrl.Call(m, "Read", b) ret0, _ := ret[0].(int) ret1, _ := ret[1].(error) return ret0, ret1 } // Read indicates an expected call of Read. -func (mr *MockConnMockRecorder) Read(arg0 interface{}) *gomock.Call { +func (mr *MockConnMockRecorder) Read(b any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockConn)(nil).Read), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockConn)(nil).Read), b) } // RemoteAddr mocks base method. @@ -159,66 +166,67 @@ func (mr *MockConnMockRecorder) RemoteAddr() *gomock.Call { } // SetDeadline mocks base method. -func (m *MockConn) SetDeadline(arg0 time.Time) error { +func (m *MockConn) SetDeadline(t time.Time) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetDeadline", arg0) + ret := m.ctrl.Call(m, "SetDeadline", t) ret0, _ := ret[0].(error) return ret0 } // SetDeadline indicates an expected call of SetDeadline. -func (mr *MockConnMockRecorder) SetDeadline(arg0 interface{}) *gomock.Call { +func (mr *MockConnMockRecorder) SetDeadline(t any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDeadline", reflect.TypeOf((*MockConn)(nil).SetDeadline), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDeadline", reflect.TypeOf((*MockConn)(nil).SetDeadline), t) } // SetReadDeadline mocks base method. -func (m *MockConn) SetReadDeadline(arg0 time.Time) error { +func (m *MockConn) SetReadDeadline(t time.Time) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetReadDeadline", arg0) + ret := m.ctrl.Call(m, "SetReadDeadline", t) ret0, _ := ret[0].(error) return ret0 } // SetReadDeadline indicates an expected call of SetReadDeadline. -func (mr *MockConnMockRecorder) SetReadDeadline(arg0 interface{}) *gomock.Call { +func (mr *MockConnMockRecorder) SetReadDeadline(t any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockConn)(nil).SetReadDeadline), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockConn)(nil).SetReadDeadline), t) } // SetWriteDeadline mocks base method. -func (m *MockConn) SetWriteDeadline(arg0 time.Time) error { +func (m *MockConn) SetWriteDeadline(t time.Time) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetWriteDeadline", arg0) + ret := m.ctrl.Call(m, "SetWriteDeadline", t) ret0, _ := ret[0].(error) return ret0 } // SetWriteDeadline indicates an expected call of SetWriteDeadline. -func (mr *MockConnMockRecorder) SetWriteDeadline(arg0 interface{}) *gomock.Call { +func (mr *MockConnMockRecorder) SetWriteDeadline(t any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWriteDeadline", reflect.TypeOf((*MockConn)(nil).SetWriteDeadline), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWriteDeadline", reflect.TypeOf((*MockConn)(nil).SetWriteDeadline), t) } // Write mocks base method. -func (m *MockConn) Write(arg0 []byte) (int, error) { +func (m *MockConn) Write(b []byte) (int, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Write", arg0) + ret := m.ctrl.Call(m, "Write", b) ret0, _ := ret[0].(int) ret1, _ := ret[1].(error) return ret0, ret1 } // Write indicates an expected call of Write. -func (mr *MockConnMockRecorder) Write(arg0 interface{}) *gomock.Call { +func (mr *MockConnMockRecorder) Write(b any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockConn)(nil).Write), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockConn)(nil).Write), b) } // MockAddr is a mock of Addr interface. type MockAddr struct { ctrl *gomock.Controller recorder *MockAddrMockRecorder + isgomock struct{} } // MockAddrMockRecorder is the mock recorder for MockAddr. diff --git a/pkg/controlsvc/ping_test.go b/pkg/controlsvc/ping_test.go index 6b606a658..f6a7dd956 100644 --- a/pkg/controlsvc/ping_test.go +++ b/pkg/controlsvc/ping_test.go @@ -8,7 +8,7 @@ import ( "github.com/ansible/receptor/pkg/controlsvc" "github.com/ansible/receptor/pkg/controlsvc/mock_controlsvc" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) func TestPingInitFromString(t *testing.T) { diff --git a/pkg/controlsvc/status_test.go b/pkg/controlsvc/status_test.go index 12a69b567..5836acab3 100644 --- a/pkg/controlsvc/status_test.go +++ b/pkg/controlsvc/status_test.go @@ -7,7 +7,7 @@ import ( "github.com/ansible/receptor/pkg/controlsvc" "github.com/ansible/receptor/pkg/controlsvc/mock_controlsvc" "github.com/ansible/receptor/pkg/netceptor" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) func TestStatusInitFromString(t *testing.T) { diff --git a/pkg/controlsvc/traceroute_test.go b/pkg/controlsvc/traceroute_test.go index 165a035a0..7c608bf25 100644 --- a/pkg/controlsvc/traceroute_test.go +++ b/pkg/controlsvc/traceroute_test.go @@ -8,7 +8,7 @@ import ( "github.com/ansible/receptor/pkg/controlsvc" "github.com/ansible/receptor/pkg/controlsvc/mock_controlsvc" "github.com/ansible/receptor/pkg/netceptor" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) func TestTracerouteInitFromString(t *testing.T) { diff --git a/pkg/framer/mock_framer/framer.go b/pkg/framer/mock_framer/framer.go index 84bc9ccb6..2e27ae225 100644 --- a/pkg/framer/mock_framer/framer.go +++ b/pkg/framer/mock_framer/framer.go @@ -1,64 +1,60 @@ // Code generated by MockGen. DO NOT EDIT. // Source: pkg/framer/framer.go +// +// Generated by this command: +// +// mockgen -source=pkg/framer/framer.go -destination=pkg/framer/mock_framer/framer.go +// // Package mock_framer is a generated GoMock package. package mock_framer import ( - gomock "github.com/golang/mock/gomock" reflect "reflect" + + gomock "go.uber.org/mock/gomock" ) -// MockFramer is a mock of Framer interface +// MockFramer is a mock of Framer interface. type MockFramer struct { ctrl *gomock.Controller recorder *MockFramerMockRecorder + isgomock struct{} } -// MockFramerMockRecorder is the mock recorder for MockFramer +// MockFramerMockRecorder is the mock recorder for MockFramer. type MockFramerMockRecorder struct { mock *MockFramer } -// NewMockFramer creates a new mock instance +// NewMockFramer creates a new mock instance. func NewMockFramer(ctrl *gomock.Controller) *MockFramer { mock := &MockFramer{ctrl: ctrl} mock.recorder = &MockFramerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockFramer) EXPECT() *MockFramerMockRecorder { return m.recorder } -// SendData mocks base method -func (m *MockFramer) SendData(data []byte) []byte { +// GetMessage mocks base method. +func (m *MockFramer) GetMessage() ([]byte, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendData", data) + ret := m.ctrl.Call(m, "GetMessage") ret0, _ := ret[0].([]byte) - return ret0 -} - -// SendData indicates an expected call of SendData -func (mr *MockFramerMockRecorder) SendData(data interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendData", reflect.TypeOf((*MockFramer)(nil).SendData), data) -} - -// RecvData mocks base method -func (m *MockFramer) RecvData(buf []byte) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "RecvData", buf) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// RecvData indicates an expected call of RecvData -func (mr *MockFramerMockRecorder) RecvData(buf interface{}) *gomock.Call { +// GetMessage indicates an expected call of GetMessage. +func (mr *MockFramerMockRecorder) GetMessage() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvData", reflect.TypeOf((*MockFramer)(nil).RecvData), buf) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMessage", reflect.TypeOf((*MockFramer)(nil).GetMessage)) } -// MessageReady mocks base method +// MessageReady mocks base method. func (m *MockFramer) MessageReady() bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "MessageReady") @@ -66,23 +62,34 @@ func (m *MockFramer) MessageReady() bool { return ret0 } -// MessageReady indicates an expected call of MessageReady +// MessageReady indicates an expected call of MessageReady. func (mr *MockFramerMockRecorder) MessageReady() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessageReady", reflect.TypeOf((*MockFramer)(nil).MessageReady)) } -// GetMessage mocks base method -func (m *MockFramer) GetMessage() ([]byte, error) { +// RecvData mocks base method. +func (m *MockFramer) RecvData(buf []byte) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetMessage") + m.ctrl.Call(m, "RecvData", buf) +} + +// RecvData indicates an expected call of RecvData. +func (mr *MockFramerMockRecorder) RecvData(buf any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvData", reflect.TypeOf((*MockFramer)(nil).RecvData), buf) +} + +// SendData mocks base method. +func (m *MockFramer) SendData(data []byte) []byte { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendData", data) ret0, _ := ret[0].([]byte) - ret1, _ := ret[1].(error) - return ret0, ret1 + return ret0 } -// GetMessage indicates an expected call of GetMessage -func (mr *MockFramerMockRecorder) GetMessage() *gomock.Call { +// SendData indicates an expected call of SendData. +func (mr *MockFramerMockRecorder) SendData(data any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMessage", reflect.TypeOf((*MockFramer)(nil).GetMessage)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendData", reflect.TypeOf((*MockFramer)(nil).SendData), data) } diff --git a/pkg/netceptor/addr_test.go b/pkg/netceptor/addr_test.go index e75b6536e..ea3218c96 100644 --- a/pkg/netceptor/addr_test.go +++ b/pkg/netceptor/addr_test.go @@ -5,7 +5,7 @@ import ( "github.com/ansible/receptor/pkg/netceptor" "github.com/ansible/receptor/pkg/netceptor/mock_netceptor" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) func TestNetwork(t *testing.T) { diff --git a/pkg/netceptor/mock_netceptor/external_backend.go b/pkg/netceptor/mock_netceptor/external_backend.go index 1851523f0..9fe9be3a2 100644 --- a/pkg/netceptor/mock_netceptor/external_backend.go +++ b/pkg/netceptor/mock_netceptor/external_backend.go @@ -1,54 +1,61 @@ // Code generated by MockGen. DO NOT EDIT. // Source: pkg/netceptor/external_backend.go +// +// Generated by this command: +// +// mockgen -source=pkg/netceptor/external_backend.go -destination=pkg/netceptor/mock_netceptor/external_backend.go +// // Package mock_netceptor is a generated GoMock package. package mock_netceptor import ( context "context" - gomock "github.com/golang/mock/gomock" reflect "reflect" time "time" + + gomock "go.uber.org/mock/gomock" ) -// MockMessageConn is a mock of MessageConn interface +// MockMessageConn is a mock of MessageConn interface. type MockMessageConn struct { ctrl *gomock.Controller recorder *MockMessageConnMockRecorder + isgomock struct{} } -// MockMessageConnMockRecorder is the mock recorder for MockMessageConn +// MockMessageConnMockRecorder is the mock recorder for MockMessageConn. type MockMessageConnMockRecorder struct { mock *MockMessageConn } -// NewMockMessageConn creates a new mock instance +// NewMockMessageConn creates a new mock instance. func NewMockMessageConn(ctrl *gomock.Controller) *MockMessageConn { mock := &MockMessageConn{ctrl: ctrl} mock.recorder = &MockMessageConnMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockMessageConn) EXPECT() *MockMessageConnMockRecorder { return m.recorder } -// WriteMessage mocks base method -func (m *MockMessageConn) WriteMessage(ctx context.Context, data []byte) error { +// Close mocks base method. +func (m *MockMessageConn) Close() error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WriteMessage", ctx, data) + ret := m.ctrl.Call(m, "Close") ret0, _ := ret[0].(error) return ret0 } -// WriteMessage indicates an expected call of WriteMessage -func (mr *MockMessageConnMockRecorder) WriteMessage(ctx, data interface{}) *gomock.Call { +// Close indicates an expected call of Close. +func (mr *MockMessageConnMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteMessage", reflect.TypeOf((*MockMessageConn)(nil).WriteMessage), ctx, data) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockMessageConn)(nil).Close)) } -// ReadMessage mocks base method +// ReadMessage mocks base method. func (m *MockMessageConn) ReadMessage(ctx context.Context, timeout time.Duration) ([]byte, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ReadMessage", ctx, timeout) @@ -57,13 +64,13 @@ func (m *MockMessageConn) ReadMessage(ctx context.Context, timeout time.Duration return ret0, ret1 } -// ReadMessage indicates an expected call of ReadMessage -func (mr *MockMessageConnMockRecorder) ReadMessage(ctx, timeout interface{}) *gomock.Call { +// ReadMessage indicates an expected call of ReadMessage. +func (mr *MockMessageConnMockRecorder) ReadMessage(ctx, timeout any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadMessage", reflect.TypeOf((*MockMessageConn)(nil).ReadMessage), ctx, timeout) } -// SetReadDeadline mocks base method +// SetReadDeadline mocks base method. func (m *MockMessageConn) SetReadDeadline(t time.Time) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SetReadDeadline", t) @@ -71,22 +78,22 @@ func (m *MockMessageConn) SetReadDeadline(t time.Time) error { return ret0 } -// SetReadDeadline indicates an expected call of SetReadDeadline -func (mr *MockMessageConnMockRecorder) SetReadDeadline(t interface{}) *gomock.Call { +// SetReadDeadline indicates an expected call of SetReadDeadline. +func (mr *MockMessageConnMockRecorder) SetReadDeadline(t any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockMessageConn)(nil).SetReadDeadline), t) } -// Close mocks base method -func (m *MockMessageConn) Close() error { +// WriteMessage mocks base method. +func (m *MockMessageConn) WriteMessage(ctx context.Context, data []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Close") + ret := m.ctrl.Call(m, "WriteMessage", ctx, data) ret0, _ := ret[0].(error) return ret0 } -// Close indicates an expected call of Close -func (mr *MockMessageConnMockRecorder) Close() *gomock.Call { +// WriteMessage indicates an expected call of WriteMessage. +func (mr *MockMessageConnMockRecorder) WriteMessage(ctx, data any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockMessageConn)(nil).Close)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteMessage", reflect.TypeOf((*MockMessageConn)(nil).WriteMessage), ctx, data) } diff --git a/pkg/netceptor/mock_netceptor/netceptor.go b/pkg/netceptor/mock_netceptor/netceptor.go index 00a06732c..82cfaf1ed 100644 --- a/pkg/netceptor/mock_netceptor/netceptor.go +++ b/pkg/netceptor/mock_netceptor/netceptor.go @@ -1,42 +1,49 @@ // Code generated by MockGen. DO NOT EDIT. // Source: pkg/netceptor/netceptor.go +// +// Generated by this command: +// +// mockgen -source=pkg/netceptor/netceptor.go -destination=pkg/netceptor/mock_netceptor/netceptor.go +// // Package mock_netceptor is a generated GoMock package. package mock_netceptor import ( context "context" - netceptor "github.com/ansible/receptor/pkg/netceptor" - gomock "github.com/golang/mock/gomock" reflect "reflect" sync "sync" time "time" + + netceptor "github.com/ansible/receptor/pkg/netceptor" + gomock "go.uber.org/mock/gomock" ) -// MockBackend is a mock of Backend interface +// MockBackend is a mock of Backend interface. type MockBackend struct { ctrl *gomock.Controller recorder *MockBackendMockRecorder + isgomock struct{} } -// MockBackendMockRecorder is the mock recorder for MockBackend +// MockBackendMockRecorder is the mock recorder for MockBackend. type MockBackendMockRecorder struct { mock *MockBackend } -// NewMockBackend creates a new mock instance +// NewMockBackend creates a new mock instance. func NewMockBackend(ctrl *gomock.Controller) *MockBackend { mock := &MockBackend{ctrl: ctrl} mock.recorder = &MockBackendMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockBackend) EXPECT() *MockBackendMockRecorder { return m.recorder } -// Start mocks base method +// Start mocks base method. func (m *MockBackend) Start(arg0 context.Context, arg1 *sync.WaitGroup) (chan netceptor.BackendSession, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Start", arg0, arg1) @@ -45,50 +52,51 @@ func (m *MockBackend) Start(arg0 context.Context, arg1 *sync.WaitGroup) (chan ne return ret0, ret1 } -// Start indicates an expected call of Start -func (mr *MockBackendMockRecorder) Start(arg0, arg1 interface{}) *gomock.Call { +// Start indicates an expected call of Start. +func (mr *MockBackendMockRecorder) Start(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockBackend)(nil).Start), arg0, arg1) } -// MockBackendSession is a mock of BackendSession interface +// MockBackendSession is a mock of BackendSession interface. type MockBackendSession struct { ctrl *gomock.Controller recorder *MockBackendSessionMockRecorder + isgomock struct{} } -// MockBackendSessionMockRecorder is the mock recorder for MockBackendSession +// MockBackendSessionMockRecorder is the mock recorder for MockBackendSession. type MockBackendSessionMockRecorder struct { mock *MockBackendSession } -// NewMockBackendSession creates a new mock instance +// NewMockBackendSession creates a new mock instance. func NewMockBackendSession(ctrl *gomock.Controller) *MockBackendSession { mock := &MockBackendSession{ctrl: ctrl} mock.recorder = &MockBackendSessionMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockBackendSession) EXPECT() *MockBackendSessionMockRecorder { return m.recorder } -// Send mocks base method -func (m *MockBackendSession) Send(arg0 []byte) error { +// Close mocks base method. +func (m *MockBackendSession) Close() error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Send", arg0) + ret := m.ctrl.Call(m, "Close") ret0, _ := ret[0].(error) return ret0 } -// Send indicates an expected call of Send -func (mr *MockBackendSessionMockRecorder) Send(arg0 interface{}) *gomock.Call { +// Close indicates an expected call of Close. +func (mr *MockBackendSessionMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockBackendSession)(nil).Send), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockBackendSession)(nil).Close)) } -// Recv mocks base method +// Recv mocks base method. func (m *MockBackendSession) Recv(arg0 time.Duration) ([]byte, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Recv", arg0) @@ -97,22 +105,22 @@ func (m *MockBackendSession) Recv(arg0 time.Duration) ([]byte, error) { return ret0, ret1 } -// Recv indicates an expected call of Recv -func (mr *MockBackendSessionMockRecorder) Recv(arg0 interface{}) *gomock.Call { +// Recv indicates an expected call of Recv. +func (mr *MockBackendSessionMockRecorder) Recv(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockBackendSession)(nil).Recv), arg0) } -// Close mocks base method -func (m *MockBackendSession) Close() error { +// Send mocks base method. +func (m *MockBackendSession) Send(arg0 []byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Close") + ret := m.ctrl.Call(m, "Send", arg0) ret0, _ := ret[0].(error) return ret0 } -// Close indicates an expected call of Close -func (mr *MockBackendSessionMockRecorder) Close() *gomock.Call { +// Send indicates an expected call of Send. +func (mr *MockBackendSessionMockRecorder) Send(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockBackendSession)(nil).Close)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockBackendSession)(nil).Send), arg0) } diff --git a/pkg/netceptor/mock_netceptor/packetconn.go b/pkg/netceptor/mock_netceptor/packetconn.go index edf51a345..c3257bd8f 100644 --- a/pkg/netceptor/mock_netceptor/packetconn.go +++ b/pkg/netceptor/mock_netceptor/packetconn.go @@ -1,116 +1,122 @@ // Code generated by MockGen. DO NOT EDIT. // Source: pkg/netceptor/packetconn.go +// +// Generated by this command: +// +// mockgen -source=pkg/netceptor/packetconn.go -destination=pkg/netceptor/mock_netceptor/packetconn.go +// // Package mock_netceptor is a generated GoMock package. package mock_netceptor import ( context "context" - logger "github.com/ansible/receptor/pkg/logger" - netceptor "github.com/ansible/receptor/pkg/netceptor" - utils "github.com/ansible/receptor/pkg/utils" - gomock "github.com/golang/mock/gomock" net "net" reflect "reflect" sync "sync" time "time" + + logger "github.com/ansible/receptor/pkg/logger" + netceptor "github.com/ansible/receptor/pkg/netceptor" + utils "github.com/ansible/receptor/pkg/utils" + gomock "go.uber.org/mock/gomock" ) -// MockPacketConner is a mock of PacketConner interface +// MockPacketConner is a mock of PacketConner interface. type MockPacketConner struct { ctrl *gomock.Controller recorder *MockPacketConnerMockRecorder + isgomock struct{} } -// MockPacketConnerMockRecorder is the mock recorder for MockPacketConner +// MockPacketConnerMockRecorder is the mock recorder for MockPacketConner. type MockPacketConnerMockRecorder struct { mock *MockPacketConner } -// NewMockPacketConner creates a new mock instance +// NewMockPacketConner creates a new mock instance. func NewMockPacketConner(ctrl *gomock.Controller) *MockPacketConner { mock := &MockPacketConner{ctrl: ctrl} mock.recorder = &MockPacketConnerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockPacketConner) EXPECT() *MockPacketConnerMockRecorder { return m.recorder } -// SetHopsToLive mocks base method -func (m *MockPacketConner) SetHopsToLive(hopsToLive byte) { +// Cancel mocks base method. +func (m *MockPacketConner) Cancel() *context.CancelFunc { m.ctrl.T.Helper() - m.ctrl.Call(m, "SetHopsToLive", hopsToLive) + ret := m.ctrl.Call(m, "Cancel") + ret0, _ := ret[0].(*context.CancelFunc) + return ret0 } -// SetHopsToLive indicates an expected call of SetHopsToLive -func (mr *MockPacketConnerMockRecorder) SetHopsToLive(hopsToLive interface{}) *gomock.Call { +// Cancel indicates an expected call of Cancel. +func (mr *MockPacketConnerMockRecorder) Cancel() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHopsToLive", reflect.TypeOf((*MockPacketConner)(nil).SetHopsToLive), hopsToLive) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cancel", reflect.TypeOf((*MockPacketConner)(nil).Cancel)) } -// GetHopsToLive mocks base method -func (m *MockPacketConner) GetHopsToLive() byte { +// Close mocks base method. +func (m *MockPacketConner) Close() error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetHopsToLive") - ret0, _ := ret[0].(byte) + ret := m.ctrl.Call(m, "Close") + ret0, _ := ret[0].(error) return ret0 } -// GetHopsToLive indicates an expected call of GetHopsToLive -func (mr *MockPacketConnerMockRecorder) GetHopsToLive() *gomock.Call { +// Close indicates an expected call of Close. +func (mr *MockPacketConnerMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHopsToLive", reflect.TypeOf((*MockPacketConner)(nil).GetHopsToLive)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockPacketConner)(nil).Close)) } -// SubscribeUnreachable mocks base method -func (m *MockPacketConner) SubscribeUnreachable(doneChan chan struct{}) chan netceptor.UnreachableNotification { +// GetHopsToLive mocks base method. +func (m *MockPacketConner) GetHopsToLive() byte { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SubscribeUnreachable", doneChan) - ret0, _ := ret[0].(chan netceptor.UnreachableNotification) + ret := m.ctrl.Call(m, "GetHopsToLive") + ret0, _ := ret[0].(byte) return ret0 } -// SubscribeUnreachable indicates an expected call of SubscribeUnreachable -func (mr *MockPacketConnerMockRecorder) SubscribeUnreachable(doneChan interface{}) *gomock.Call { +// GetHopsToLive indicates an expected call of GetHopsToLive. +func (mr *MockPacketConnerMockRecorder) GetHopsToLive() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeUnreachable", reflect.TypeOf((*MockPacketConner)(nil).SubscribeUnreachable), doneChan) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHopsToLive", reflect.TypeOf((*MockPacketConner)(nil).GetHopsToLive)) } -// ReadFrom mocks base method -func (m *MockPacketConner) ReadFrom(p []byte) (int, net.Addr, error) { +// GetLogger mocks base method. +func (m *MockPacketConner) GetLogger() *logger.ReceptorLogger { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ReadFrom", p) - ret0, _ := ret[0].(int) - ret1, _ := ret[1].(net.Addr) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 + ret := m.ctrl.Call(m, "GetLogger") + ret0, _ := ret[0].(*logger.ReceptorLogger) + return ret0 } -// ReadFrom indicates an expected call of ReadFrom -func (mr *MockPacketConnerMockRecorder) ReadFrom(p interface{}) *gomock.Call { +// GetLogger indicates an expected call of GetLogger. +func (mr *MockPacketConnerMockRecorder) GetLogger() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadFrom", reflect.TypeOf((*MockPacketConner)(nil).ReadFrom), p) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogger", reflect.TypeOf((*MockPacketConner)(nil).GetLogger)) } -// WriteTo mocks base method -func (m *MockPacketConner) WriteTo(p []byte, addr net.Addr) (int, error) { +// GetReadDeadline mocks base method. +func (m *MockPacketConner) GetReadDeadline() time.Time { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WriteTo", p, addr) - ret0, _ := ret[0].(int) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret := m.ctrl.Call(m, "GetReadDeadline") + ret0, _ := ret[0].(time.Time) + return ret0 } -// WriteTo indicates an expected call of WriteTo -func (mr *MockPacketConnerMockRecorder) WriteTo(p, addr interface{}) *gomock.Call { +// GetReadDeadline indicates an expected call of GetReadDeadline. +func (mr *MockPacketConnerMockRecorder) GetReadDeadline() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteTo", reflect.TypeOf((*MockPacketConner)(nil).WriteTo), p, addr) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReadDeadline", reflect.TypeOf((*MockPacketConner)(nil).GetReadDeadline)) } -// LocalAddr mocks base method +// LocalAddr mocks base method. func (m *MockPacketConner) LocalAddr() net.Addr { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LocalAddr") @@ -118,174 +124,174 @@ func (m *MockPacketConner) LocalAddr() net.Addr { return ret0 } -// LocalAddr indicates an expected call of LocalAddr +// LocalAddr indicates an expected call of LocalAddr. func (mr *MockPacketConnerMockRecorder) LocalAddr() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocalAddr", reflect.TypeOf((*MockPacketConner)(nil).LocalAddr)) } -// Close mocks base method -func (m *MockPacketConner) Close() error { +// LocalService mocks base method. +func (m *MockPacketConner) LocalService() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Close") - ret0, _ := ret[0].(error) + ret := m.ctrl.Call(m, "LocalService") + ret0, _ := ret[0].(string) return ret0 } -// Close indicates an expected call of Close -func (mr *MockPacketConnerMockRecorder) Close() *gomock.Call { +// LocalService indicates an expected call of LocalService. +func (mr *MockPacketConnerMockRecorder) LocalService() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockPacketConner)(nil).Close)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocalService", reflect.TypeOf((*MockPacketConner)(nil).LocalService)) } -// SetDeadline mocks base method -func (m *MockPacketConner) SetDeadline(t time.Time) error { +// ReadFrom mocks base method. +func (m *MockPacketConner) ReadFrom(p []byte) (int, net.Addr, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetDeadline", t) - ret0, _ := ret[0].(error) - return ret0 + ret := m.ctrl.Call(m, "ReadFrom", p) + ret0, _ := ret[0].(int) + ret1, _ := ret[1].(net.Addr) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } -// SetDeadline indicates an expected call of SetDeadline -func (mr *MockPacketConnerMockRecorder) SetDeadline(t interface{}) *gomock.Call { +// ReadFrom indicates an expected call of ReadFrom. +func (mr *MockPacketConnerMockRecorder) ReadFrom(p any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDeadline", reflect.TypeOf((*MockPacketConner)(nil).SetDeadline), t) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadFrom", reflect.TypeOf((*MockPacketConner)(nil).ReadFrom), p) } -// SetReadDeadline mocks base method -func (m *MockPacketConner) SetReadDeadline(t time.Time) error { +// SetDeadline mocks base method. +func (m *MockPacketConner) SetDeadline(t time.Time) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetReadDeadline", t) + ret := m.ctrl.Call(m, "SetDeadline", t) ret0, _ := ret[0].(error) return ret0 } -// SetReadDeadline indicates an expected call of SetReadDeadline -func (mr *MockPacketConnerMockRecorder) SetReadDeadline(t interface{}) *gomock.Call { +// SetDeadline indicates an expected call of SetDeadline. +func (mr *MockPacketConnerMockRecorder) SetDeadline(t any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockPacketConner)(nil).SetReadDeadline), t) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDeadline", reflect.TypeOf((*MockPacketConner)(nil).SetDeadline), t) } -// GetReadDeadline mocks base method -func (m *MockPacketConner) GetReadDeadline() time.Time { +// SetHopsToLive mocks base method. +func (m *MockPacketConner) SetHopsToLive(hopsToLive byte) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetReadDeadline") - ret0, _ := ret[0].(time.Time) - return ret0 + m.ctrl.Call(m, "SetHopsToLive", hopsToLive) } -// GetReadDeadline indicates an expected call of GetReadDeadline -func (mr *MockPacketConnerMockRecorder) GetReadDeadline() *gomock.Call { +// SetHopsToLive indicates an expected call of SetHopsToLive. +func (mr *MockPacketConnerMockRecorder) SetHopsToLive(hopsToLive any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReadDeadline", reflect.TypeOf((*MockPacketConner)(nil).GetReadDeadline)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHopsToLive", reflect.TypeOf((*MockPacketConner)(nil).SetHopsToLive), hopsToLive) } -// SetWriteDeadline mocks base method -func (m *MockPacketConner) SetWriteDeadline(t time.Time) error { +// SetReadDeadline mocks base method. +func (m *MockPacketConner) SetReadDeadline(t time.Time) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetWriteDeadline", t) + ret := m.ctrl.Call(m, "SetReadDeadline", t) ret0, _ := ret[0].(error) return ret0 } -// SetWriteDeadline indicates an expected call of SetWriteDeadline -func (mr *MockPacketConnerMockRecorder) SetWriteDeadline(t interface{}) *gomock.Call { +// SetReadDeadline indicates an expected call of SetReadDeadline. +func (mr *MockPacketConnerMockRecorder) SetReadDeadline(t any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWriteDeadline", reflect.TypeOf((*MockPacketConner)(nil).SetWriteDeadline), t) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockPacketConner)(nil).SetReadDeadline), t) } -// Cancel mocks base method -func (m *MockPacketConner) Cancel() *context.CancelFunc { +// SetWriteDeadline mocks base method. +func (m *MockPacketConner) SetWriteDeadline(t time.Time) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Cancel") - ret0, _ := ret[0].(*context.CancelFunc) + ret := m.ctrl.Call(m, "SetWriteDeadline", t) + ret0, _ := ret[0].(error) return ret0 } -// Cancel indicates an expected call of Cancel -func (mr *MockPacketConnerMockRecorder) Cancel() *gomock.Call { +// SetWriteDeadline indicates an expected call of SetWriteDeadline. +func (mr *MockPacketConnerMockRecorder) SetWriteDeadline(t any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cancel", reflect.TypeOf((*MockPacketConner)(nil).Cancel)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWriteDeadline", reflect.TypeOf((*MockPacketConner)(nil).SetWriteDeadline), t) } -// LocalService mocks base method -func (m *MockPacketConner) LocalService() string { +// StartUnreachable mocks base method. +func (m *MockPacketConner) StartUnreachable() { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LocalService") - ret0, _ := ret[0].(string) - return ret0 + m.ctrl.Call(m, "StartUnreachable") } -// LocalService indicates an expected call of LocalService -func (mr *MockPacketConnerMockRecorder) LocalService() *gomock.Call { +// StartUnreachable indicates an expected call of StartUnreachable. +func (mr *MockPacketConnerMockRecorder) StartUnreachable() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LocalService", reflect.TypeOf((*MockPacketConner)(nil).LocalService)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartUnreachable", reflect.TypeOf((*MockPacketConner)(nil).StartUnreachable)) } -// GetLogger mocks base method -func (m *MockPacketConner) GetLogger() *logger.ReceptorLogger { +// SubscribeUnreachable mocks base method. +func (m *MockPacketConner) SubscribeUnreachable(doneChan chan struct{}) chan netceptor.UnreachableNotification { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetLogger") - ret0, _ := ret[0].(*logger.ReceptorLogger) + ret := m.ctrl.Call(m, "SubscribeUnreachable", doneChan) + ret0, _ := ret[0].(chan netceptor.UnreachableNotification) return ret0 } -// GetLogger indicates an expected call of GetLogger -func (mr *MockPacketConnerMockRecorder) GetLogger() *gomock.Call { +// SubscribeUnreachable indicates an expected call of SubscribeUnreachable. +func (mr *MockPacketConnerMockRecorder) SubscribeUnreachable(doneChan any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogger", reflect.TypeOf((*MockPacketConner)(nil).GetLogger)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeUnreachable", reflect.TypeOf((*MockPacketConner)(nil).SubscribeUnreachable), doneChan) } -// StartUnreachable mocks base method -func (m *MockPacketConner) StartUnreachable() { +// WriteTo mocks base method. +func (m *MockPacketConner) WriteTo(p []byte, addr net.Addr) (int, error) { m.ctrl.T.Helper() - m.ctrl.Call(m, "StartUnreachable") + ret := m.ctrl.Call(m, "WriteTo", p, addr) + ret0, _ := ret[0].(int) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// StartUnreachable indicates an expected call of StartUnreachable -func (mr *MockPacketConnerMockRecorder) StartUnreachable() *gomock.Call { +// WriteTo indicates an expected call of WriteTo. +func (mr *MockPacketConnerMockRecorder) WriteTo(p, addr any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartUnreachable", reflect.TypeOf((*MockPacketConner)(nil).StartUnreachable)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteTo", reflect.TypeOf((*MockPacketConner)(nil).WriteTo), p, addr) } -// MockNetcForPacketConn is a mock of NetcForPacketConn interface +// MockNetcForPacketConn is a mock of NetcForPacketConn interface. type MockNetcForPacketConn struct { ctrl *gomock.Controller recorder *MockNetcForPacketConnMockRecorder + isgomock struct{} } -// MockNetcForPacketConnMockRecorder is the mock recorder for MockNetcForPacketConn +// MockNetcForPacketConnMockRecorder is the mock recorder for MockNetcForPacketConn. type MockNetcForPacketConnMockRecorder struct { mock *MockNetcForPacketConn } -// NewMockNetcForPacketConn creates a new mock instance +// NewMockNetcForPacketConn creates a new mock instance. func NewMockNetcForPacketConn(ctrl *gomock.Controller) *MockNetcForPacketConn { mock := &MockNetcForPacketConn{ctrl: ctrl} mock.recorder = &MockNetcForPacketConnMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockNetcForPacketConn) EXPECT() *MockNetcForPacketConnMockRecorder { return m.recorder } -// GetEphemeralService mocks base method -func (m *MockNetcForPacketConn) GetEphemeralService() string { +// AddLocalServiceAdvertisement mocks base method. +func (m *MockNetcForPacketConn) AddLocalServiceAdvertisement(service string, connType byte, tags map[string]string) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetEphemeralService") - ret0, _ := ret[0].(string) - return ret0 + m.ctrl.Call(m, "AddLocalServiceAdvertisement", service, connType, tags) } -// GetEphemeralService indicates an expected call of GetEphemeralService -func (mr *MockNetcForPacketConnMockRecorder) GetEphemeralService() *gomock.Call { +// AddLocalServiceAdvertisement indicates an expected call of AddLocalServiceAdvertisement. +func (mr *MockNetcForPacketConnMockRecorder) AddLocalServiceAdvertisement(service, connType, tags any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEphemeralService", reflect.TypeOf((*MockNetcForPacketConn)(nil).GetEphemeralService)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLocalServiceAdvertisement", reflect.TypeOf((*MockNetcForPacketConn)(nil).AddLocalServiceAdvertisement), service, connType, tags) } -// AddNameHash mocks base method +// AddNameHash mocks base method. func (m *MockNetcForPacketConn) AddNameHash(name string) uint64 { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AddNameHash", name) @@ -293,81 +299,83 @@ func (m *MockNetcForPacketConn) AddNameHash(name string) uint64 { return ret0 } -// AddNameHash indicates an expected call of AddNameHash -func (mr *MockNetcForPacketConnMockRecorder) AddNameHash(name interface{}) *gomock.Call { +// AddNameHash indicates an expected call of AddNameHash. +func (mr *MockNetcForPacketConnMockRecorder) AddNameHash(name any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddNameHash", reflect.TypeOf((*MockNetcForPacketConn)(nil).AddNameHash), name) } -// AddLocalServiceAdvertisement mocks base method -func (m *MockNetcForPacketConn) AddLocalServiceAdvertisement(service string, connType byte, tags map[string]string) { +// Context mocks base method. +func (m *MockNetcForPacketConn) Context() context.Context { m.ctrl.T.Helper() - m.ctrl.Call(m, "AddLocalServiceAdvertisement", service, connType, tags) + ret := m.ctrl.Call(m, "Context") + ret0, _ := ret[0].(context.Context) + return ret0 } -// AddLocalServiceAdvertisement indicates an expected call of AddLocalServiceAdvertisement -func (mr *MockNetcForPacketConnMockRecorder) AddLocalServiceAdvertisement(service, connType, tags interface{}) *gomock.Call { +// Context indicates an expected call of Context. +func (mr *MockNetcForPacketConnMockRecorder) Context() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddLocalServiceAdvertisement", reflect.TypeOf((*MockNetcForPacketConn)(nil).AddLocalServiceAdvertisement), service, connType, tags) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockNetcForPacketConn)(nil).Context)) } -// SendMessageWithHopsToLive mocks base method -func (m *MockNetcForPacketConn) SendMessageWithHopsToLive(fromService, toNode, toService string, data []byte, hopsToLive byte) error { +// GetEphemeralService mocks base method. +func (m *MockNetcForPacketConn) GetEphemeralService() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendMessageWithHopsToLive", fromService, toNode, toService, data, hopsToLive) - ret0, _ := ret[0].(error) + ret := m.ctrl.Call(m, "GetEphemeralService") + ret0, _ := ret[0].(string) return ret0 } -// SendMessageWithHopsToLive indicates an expected call of SendMessageWithHopsToLive -func (mr *MockNetcForPacketConnMockRecorder) SendMessageWithHopsToLive(fromService, toNode, toService, data, hopsToLive interface{}) *gomock.Call { +// GetEphemeralService indicates an expected call of GetEphemeralService. +func (mr *MockNetcForPacketConnMockRecorder) GetEphemeralService() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessageWithHopsToLive", reflect.TypeOf((*MockNetcForPacketConn)(nil).SendMessageWithHopsToLive), fromService, toNode, toService, data, hopsToLive) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEphemeralService", reflect.TypeOf((*MockNetcForPacketConn)(nil).GetEphemeralService)) } -// RemoveLocalServiceAdvertisement mocks base method -func (m *MockNetcForPacketConn) RemoveLocalServiceAdvertisement(service string) error { +// GetListenerLock mocks base method. +func (m *MockNetcForPacketConn) GetListenerLock() *sync.RWMutex { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RemoveLocalServiceAdvertisement", service) - ret0, _ := ret[0].(error) + ret := m.ctrl.Call(m, "GetListenerLock") + ret0, _ := ret[0].(*sync.RWMutex) return ret0 } -// RemoveLocalServiceAdvertisement indicates an expected call of RemoveLocalServiceAdvertisement -func (mr *MockNetcForPacketConnMockRecorder) RemoveLocalServiceAdvertisement(service interface{}) *gomock.Call { +// GetListenerLock indicates an expected call of GetListenerLock. +func (mr *MockNetcForPacketConnMockRecorder) GetListenerLock() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveLocalServiceAdvertisement", reflect.TypeOf((*MockNetcForPacketConn)(nil).RemoveLocalServiceAdvertisement), service) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListenerLock", reflect.TypeOf((*MockNetcForPacketConn)(nil).GetListenerLock)) } -// GetLogger mocks base method -func (m *MockNetcForPacketConn) GetLogger() *logger.ReceptorLogger { +// GetListenerRegistry mocks base method. +func (m *MockNetcForPacketConn) GetListenerRegistry() map[string]*netceptor.PacketConn { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetLogger") - ret0, _ := ret[0].(*logger.ReceptorLogger) + ret := m.ctrl.Call(m, "GetListenerRegistry") + ret0, _ := ret[0].(map[string]*netceptor.PacketConn) return ret0 } -// GetLogger indicates an expected call of GetLogger -func (mr *MockNetcForPacketConnMockRecorder) GetLogger() *gomock.Call { +// GetListenerRegistry indicates an expected call of GetListenerRegistry. +func (mr *MockNetcForPacketConnMockRecorder) GetListenerRegistry() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogger", reflect.TypeOf((*MockNetcForPacketConn)(nil).GetLogger)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListenerRegistry", reflect.TypeOf((*MockNetcForPacketConn)(nil).GetListenerRegistry)) } -// NodeID mocks base method -func (m *MockNetcForPacketConn) NodeID() string { +// GetLogger mocks base method. +func (m *MockNetcForPacketConn) GetLogger() *logger.ReceptorLogger { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeID") - ret0, _ := ret[0].(string) + ret := m.ctrl.Call(m, "GetLogger") + ret0, _ := ret[0].(*logger.ReceptorLogger) return ret0 } -// NodeID indicates an expected call of NodeID -func (mr *MockNetcForPacketConnMockRecorder) NodeID() *gomock.Call { +// GetLogger indicates an expected call of GetLogger. +func (mr *MockNetcForPacketConnMockRecorder) GetLogger() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeID", reflect.TypeOf((*MockNetcForPacketConn)(nil).NodeID)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogger", reflect.TypeOf((*MockNetcForPacketConn)(nil).GetLogger)) } -// GetNetworkName mocks base method +// GetNetworkName mocks base method. func (m *MockNetcForPacketConn) GetNetworkName() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetNetworkName") @@ -375,78 +383,78 @@ func (m *MockNetcForPacketConn) GetNetworkName() string { return ret0 } -// GetNetworkName indicates an expected call of GetNetworkName +// GetNetworkName indicates an expected call of GetNetworkName. func (mr *MockNetcForPacketConnMockRecorder) GetNetworkName() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNetworkName", reflect.TypeOf((*MockNetcForPacketConn)(nil).GetNetworkName)) } -// GetListenerLock mocks base method -func (m *MockNetcForPacketConn) GetListenerLock() *sync.RWMutex { +// GetUnreachableBroker mocks base method. +func (m *MockNetcForPacketConn) GetUnreachableBroker() *utils.Broker { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetListenerLock") - ret0, _ := ret[0].(*sync.RWMutex) + ret := m.ctrl.Call(m, "GetUnreachableBroker") + ret0, _ := ret[0].(*utils.Broker) return ret0 } -// GetListenerLock indicates an expected call of GetListenerLock -func (mr *MockNetcForPacketConnMockRecorder) GetListenerLock() *gomock.Call { +// GetUnreachableBroker indicates an expected call of GetUnreachableBroker. +func (mr *MockNetcForPacketConnMockRecorder) GetUnreachableBroker() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListenerLock", reflect.TypeOf((*MockNetcForPacketConn)(nil).GetListenerLock)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUnreachableBroker", reflect.TypeOf((*MockNetcForPacketConn)(nil).GetUnreachableBroker)) } -// GetListenerRegistry mocks base method -func (m *MockNetcForPacketConn) GetListenerRegistry() map[string]*netceptor.PacketConn { +// MaxForwardingHops mocks base method. +func (m *MockNetcForPacketConn) MaxForwardingHops() byte { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetListenerRegistry") - ret0, _ := ret[0].(map[string]*netceptor.PacketConn) + ret := m.ctrl.Call(m, "MaxForwardingHops") + ret0, _ := ret[0].(byte) return ret0 } -// GetListenerRegistry indicates an expected call of GetListenerRegistry -func (mr *MockNetcForPacketConnMockRecorder) GetListenerRegistry() *gomock.Call { +// MaxForwardingHops indicates an expected call of MaxForwardingHops. +func (mr *MockNetcForPacketConnMockRecorder) MaxForwardingHops() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListenerRegistry", reflect.TypeOf((*MockNetcForPacketConn)(nil).GetListenerRegistry)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaxForwardingHops", reflect.TypeOf((*MockNetcForPacketConn)(nil).MaxForwardingHops)) } -// GetUnreachableBroker mocks base method -func (m *MockNetcForPacketConn) GetUnreachableBroker() *utils.Broker { +// NodeID mocks base method. +func (m *MockNetcForPacketConn) NodeID() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetUnreachableBroker") - ret0, _ := ret[0].(*utils.Broker) + ret := m.ctrl.Call(m, "NodeID") + ret0, _ := ret[0].(string) return ret0 } -// GetUnreachableBroker indicates an expected call of GetUnreachableBroker -func (mr *MockNetcForPacketConnMockRecorder) GetUnreachableBroker() *gomock.Call { +// NodeID indicates an expected call of NodeID. +func (mr *MockNetcForPacketConnMockRecorder) NodeID() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUnreachableBroker", reflect.TypeOf((*MockNetcForPacketConn)(nil).GetUnreachableBroker)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeID", reflect.TypeOf((*MockNetcForPacketConn)(nil).NodeID)) } -// MaxForwardingHops mocks base method -func (m *MockNetcForPacketConn) MaxForwardingHops() byte { +// RemoveLocalServiceAdvertisement mocks base method. +func (m *MockNetcForPacketConn) RemoveLocalServiceAdvertisement(service string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MaxForwardingHops") - ret0, _ := ret[0].(byte) + ret := m.ctrl.Call(m, "RemoveLocalServiceAdvertisement", service) + ret0, _ := ret[0].(error) return ret0 } -// MaxForwardingHops indicates an expected call of MaxForwardingHops -func (mr *MockNetcForPacketConnMockRecorder) MaxForwardingHops() *gomock.Call { +// RemoveLocalServiceAdvertisement indicates an expected call of RemoveLocalServiceAdvertisement. +func (mr *MockNetcForPacketConnMockRecorder) RemoveLocalServiceAdvertisement(service any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaxForwardingHops", reflect.TypeOf((*MockNetcForPacketConn)(nil).MaxForwardingHops)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveLocalServiceAdvertisement", reflect.TypeOf((*MockNetcForPacketConn)(nil).RemoveLocalServiceAdvertisement), service) } -// Context mocks base method -func (m *MockNetcForPacketConn) Context() context.Context { +// SendMessageWithHopsToLive mocks base method. +func (m *MockNetcForPacketConn) SendMessageWithHopsToLive(fromService, toNode, toService string, data []byte, hopsToLive byte) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Context") - ret0, _ := ret[0].(context.Context) + ret := m.ctrl.Call(m, "SendMessageWithHopsToLive", fromService, toNode, toService, data, hopsToLive) + ret0, _ := ret[0].(error) return ret0 } -// Context indicates an expected call of Context -func (mr *MockNetcForPacketConnMockRecorder) Context() *gomock.Call { +// SendMessageWithHopsToLive indicates an expected call of SendMessageWithHopsToLive. +func (mr *MockNetcForPacketConnMockRecorder) SendMessageWithHopsToLive(fromService, toNode, toService, data, hopsToLive any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockNetcForPacketConn)(nil).Context)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessageWithHopsToLive", reflect.TypeOf((*MockNetcForPacketConn)(nil).SendMessageWithHopsToLive), fromService, toNode, toService, data, hopsToLive) } diff --git a/pkg/netceptor/mock_netceptor/ping.go b/pkg/netceptor/mock_netceptor/ping.go index 76abdde29..60e7d3f76 100644 --- a/pkg/netceptor/mock_netceptor/ping.go +++ b/pkg/netceptor/mock_netceptor/ping.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: pkg/netceptor/ping.go +// +// Generated by this command: +// +// mockgen -source=pkg/netceptor/ping.go -destination=pkg/netceptor/mock_netceptor/ping.go +// // Package mock_netceptor is a generated GoMock package. package mock_netceptor @@ -10,13 +15,14 @@ import ( time "time" netceptor "github.com/ansible/receptor/pkg/netceptor" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockNetcForPing is a mock of NetcForPing interface. type MockNetcForPing struct { ctrl *gomock.Controller recorder *MockNetcForPingMockRecorder + isgomock struct{} } // MockNetcForPingMockRecorder is the mock recorder for MockNetcForPing. @@ -60,7 +66,7 @@ func (m *MockNetcForPing) ListenPacket(service string) (netceptor.PacketConner, } // ListenPacket indicates an expected call of ListenPacket. -func (mr *MockNetcForPingMockRecorder) ListenPacket(service interface{}) *gomock.Call { +func (mr *MockNetcForPingMockRecorder) ListenPacket(service any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListenPacket", reflect.TypeOf((*MockNetcForPing)(nil).ListenPacket), service) } @@ -74,7 +80,7 @@ func (m *MockNetcForPing) NewAddr(target, service string) netceptor.Addr { } // NewAddr indicates an expected call of NewAddr. -func (mr *MockNetcForPingMockRecorder) NewAddr(target, service interface{}) *gomock.Call { +func (mr *MockNetcForPingMockRecorder) NewAddr(target, service any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewAddr", reflect.TypeOf((*MockNetcForPing)(nil).NewAddr), target, service) } @@ -97,6 +103,7 @@ func (mr *MockNetcForPingMockRecorder) NodeID() *gomock.Call { type MockNetcForTraceroute struct { ctrl *gomock.Controller recorder *MockNetcForTracerouteMockRecorder + isgomock struct{} } // MockNetcForTracerouteMockRecorder is the mock recorder for MockNetcForTraceroute. @@ -155,7 +162,7 @@ func (m *MockNetcForTraceroute) Ping(ctx context.Context, target string, hopsToL } // Ping indicates an expected call of Ping. -func (mr *MockNetcForTracerouteMockRecorder) Ping(ctx, target, hopsToLive interface{}) *gomock.Call { +func (mr *MockNetcForTracerouteMockRecorder) Ping(ctx, target, hopsToLive any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ping", reflect.TypeOf((*MockNetcForTraceroute)(nil).Ping), ctx, target, hopsToLive) } diff --git a/pkg/netceptor/packetconn_test.go b/pkg/netceptor/packetconn_test.go index 26e456f40..238d5446f 100644 --- a/pkg/netceptor/packetconn_test.go +++ b/pkg/netceptor/packetconn_test.go @@ -12,7 +12,7 @@ import ( "github.com/ansible/receptor/pkg/netceptor" "github.com/ansible/receptor/pkg/netceptor/mock_netceptor" "github.com/ansible/receptor/pkg/utils" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) const ( diff --git a/pkg/netceptor/ping_test.go b/pkg/netceptor/ping_test.go index 6ea48605e..ef9c7f080 100644 --- a/pkg/netceptor/ping_test.go +++ b/pkg/netceptor/ping_test.go @@ -9,7 +9,7 @@ import ( "github.com/ansible/receptor/pkg/netceptor" "github.com/ansible/receptor/pkg/netceptor/mock_netceptor" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) // setupTest sets up TestPing tests. diff --git a/pkg/workceptor/command_test.go b/pkg/workceptor/command_test.go index 813dfaf27..985bbd96f 100644 --- a/pkg/workceptor/command_test.go +++ b/pkg/workceptor/command_test.go @@ -11,7 +11,7 @@ import ( "github.com/ansible/receptor/pkg/workceptor" "github.com/ansible/receptor/pkg/workceptor/mock_workceptor" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) func statusExpectCalls(mockBaseWorkUnit *mock_workceptor.MockBaseWorkUnitForWorkUnit) { diff --git a/pkg/workceptor/kubernetes_test.go b/pkg/workceptor/kubernetes_test.go index d42f11940..fc2e3d1ca 100644 --- a/pkg/workceptor/kubernetes_test.go +++ b/pkg/workceptor/kubernetes_test.go @@ -12,7 +12,7 @@ import ( "github.com/ansible/receptor/pkg/netceptor" "github.com/ansible/receptor/pkg/workceptor" "github.com/ansible/receptor/pkg/workceptor/mock_workceptor" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/workceptor/mock_workceptor/baseworkunit.go b/pkg/workceptor/mock_workceptor/baseworkunit.go index da19ba9ae..87c2c2297 100644 --- a/pkg/workceptor/mock_workceptor/baseworkunit.go +++ b/pkg/workceptor/mock_workceptor/baseworkunit.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/ansible/receptor/pkg/workceptor (interfaces: BaseWorkUnitForWorkUnit) +// +// Generated by this command: +// +// mockgen . BaseWorkUnitForWorkUnit +// // Package mock_workceptor is a generated GoMock package. package mock_workceptor @@ -10,13 +15,14 @@ import ( sync "sync" workceptor "github.com/ansible/receptor/pkg/workceptor" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockBaseWorkUnitForWorkUnit is a mock of BaseWorkUnitForWorkUnit interface. type MockBaseWorkUnitForWorkUnit struct { ctrl *gomock.Controller recorder *MockBaseWorkUnitForWorkUnitMockRecorder + isgomock struct{} } // MockBaseWorkUnitForWorkUnitMockRecorder is the mock recorder for MockBaseWorkUnitForWorkUnit. @@ -48,40 +54,6 @@ func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) CancelContext() *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelContext", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).CancelContext)) } -// Debug mocks base method. -func (m *MockBaseWorkUnitForWorkUnit) Debug(arg0 string, arg1 ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Debug", varargs...) -} - -// Debug indicates an expected call of Debug. -func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) Debug(arg0 interface{}, arg1 ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Debug", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).Debug), varargs...) -} - -// Error mocks base method. -func (m *MockBaseWorkUnitForWorkUnit) Error(arg0 string, arg1 ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Error", varargs...) -} - -// Error indicates an expected call of Error. -func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) Error(arg0 interface{}, arg1 ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).Error), varargs...) -} - // GetCancel mocks base method. func (m *MockBaseWorkUnitForWorkUnit) GetCancel() context.CancelFunc { m.ctrl.T.Helper() @@ -180,33 +152,16 @@ func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) ID() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).ID)) } -// Info mocks base method. -func (m *MockBaseWorkUnitForWorkUnit) Info(arg0 string, arg1 ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Info", varargs...) -} - -// Info indicates an expected call of Info. -func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) Info(arg0 interface{}, arg1 ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).Info), varargs...) -} - // Init mocks base method. -func (m *MockBaseWorkUnitForWorkUnit) Init(arg0 *workceptor.Workceptor, arg1, arg2 string, arg3 workceptor.FileSystemer, arg4 workceptor.WatcherWrapper) { +func (m *MockBaseWorkUnitForWorkUnit) Init(w *workceptor.Workceptor, unitID, workType string, fs workceptor.FileSystemer, watcher workceptor.WatcherWrapper) { m.ctrl.T.Helper() - m.ctrl.Call(m, "Init", arg0, arg1, arg2, arg3, arg4) + m.ctrl.Call(m, "Init", w, unitID, workType, fs, watcher) } // Init indicates an expected call of Init. -func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) Init(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) Init(w, unitID, workType, fs, watcher any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).Init), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).Init), w, unitID, workType, fs, watcher) } // LastUpdateError mocks base method. @@ -250,17 +205,17 @@ func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) MonitorLocalStatus() *gomock. } // Release mocks base method. -func (m *MockBaseWorkUnitForWorkUnit) Release(arg0 bool) error { +func (m *MockBaseWorkUnitForWorkUnit) Release(force bool) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Release", arg0) + ret := m.ctrl.Call(m, "Release", force) ret0, _ := ret[0].(error) return ret0 } // Release indicates an expected call of Release. -func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) Release(arg0 interface{}) *gomock.Call { +func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) Release(force any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Release", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).Release), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Release", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).Release), force) } // Save mocks base method. @@ -286,19 +241,19 @@ func (m *MockBaseWorkUnitForWorkUnit) SetFromParams(arg0 map[string]string) erro } // SetFromParams indicates an expected call of SetFromParams. -func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) SetFromParams(arg0 interface{}) *gomock.Call { +func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) SetFromParams(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetFromParams", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).SetFromParams), arg0) } // SetStatusExtraData mocks base method. -func (m *MockBaseWorkUnitForWorkUnit) SetStatusExtraData(arg0 interface{}) { +func (m *MockBaseWorkUnitForWorkUnit) SetStatusExtraData(arg0 any) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetStatusExtraData", arg0) } // SetStatusExtraData indicates an expected call of SetStatusExtraData. -func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) SetStatusExtraData(arg0 interface{}) *gomock.Call { +func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) SetStatusExtraData(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStatusExtraData", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).SetStatusExtraData), arg0) } @@ -310,7 +265,7 @@ func (m *MockBaseWorkUnitForWorkUnit) SetWorkceptor(arg0 *workceptor.Workceptor) } // SetWorkceptor indicates an expected call of SetWorkceptor. -func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) SetWorkceptor(arg0 interface{}) *gomock.Call { +func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) SetWorkceptor(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWorkceptor", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).SetWorkceptor), arg0) } @@ -386,42 +341,25 @@ func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) UnredactedStatus() *gomock.Ca } // UpdateBasicStatus mocks base method. -func (m *MockBaseWorkUnitForWorkUnit) UpdateBasicStatus(arg0 int, arg1 string, arg2 int64) { +func (m *MockBaseWorkUnitForWorkUnit) UpdateBasicStatus(state int, detail string, stdoutSize int64) { m.ctrl.T.Helper() - m.ctrl.Call(m, "UpdateBasicStatus", arg0, arg1, arg2) + m.ctrl.Call(m, "UpdateBasicStatus", state, detail, stdoutSize) } // UpdateBasicStatus indicates an expected call of UpdateBasicStatus. -func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) UpdateBasicStatus(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) UpdateBasicStatus(state, detail, stdoutSize any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBasicStatus", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).UpdateBasicStatus), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBasicStatus", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).UpdateBasicStatus), state, detail, stdoutSize) } // UpdateFullStatus mocks base method. -func (m *MockBaseWorkUnitForWorkUnit) UpdateFullStatus(arg0 func(*workceptor.StatusFileData)) { +func (m *MockBaseWorkUnitForWorkUnit) UpdateFullStatus(statusFunc func(*workceptor.StatusFileData)) { m.ctrl.T.Helper() - m.ctrl.Call(m, "UpdateFullStatus", arg0) + m.ctrl.Call(m, "UpdateFullStatus", statusFunc) } // UpdateFullStatus indicates an expected call of UpdateFullStatus. -func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) UpdateFullStatus(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateFullStatus", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).UpdateFullStatus), arg0) -} - -// Warning mocks base method. -func (m *MockBaseWorkUnitForWorkUnit) Warning(arg0 string, arg1 ...interface{}) { - m.ctrl.T.Helper() - varargs := []interface{}{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - m.ctrl.Call(m, "Warning", varargs...) -} - -// Warning indicates an expected call of Warning. -func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) Warning(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +func (mr *MockBaseWorkUnitForWorkUnitMockRecorder) UpdateFullStatus(statusFunc any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Warning", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).Warning), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateFullStatus", reflect.TypeOf((*MockBaseWorkUnitForWorkUnit)(nil).UpdateFullStatus), statusFunc) } diff --git a/pkg/workceptor/mock_workceptor/interfaces.go b/pkg/workceptor/mock_workceptor/interfaces.go index 49120e499..0eea594f7 100644 --- a/pkg/workceptor/mock_workceptor/interfaces.go +++ b/pkg/workceptor/mock_workceptor/interfaces.go @@ -1,39 +1,60 @@ // Code generated by MockGen. DO NOT EDIT. // Source: pkg/workceptor/interfaces.go +// +// Generated by this command: +// +// mockgen -source=pkg/workceptor/interfaces.go -destination=pkg/workceptor/mock_workceptor/interfaces.go +// // Package mock_workceptor is a generated GoMock package. package mock_workceptor import ( - workceptor "github.com/ansible/receptor/pkg/workceptor" - gomock "github.com/golang/mock/gomock" reflect "reflect" + + workceptor "github.com/ansible/receptor/pkg/workceptor" + gomock "go.uber.org/mock/gomock" ) -// MockWorkUnit is a mock of WorkUnit interface +// MockWorkUnit is a mock of WorkUnit interface. type MockWorkUnit struct { ctrl *gomock.Controller recorder *MockWorkUnitMockRecorder + isgomock struct{} } -// MockWorkUnitMockRecorder is the mock recorder for MockWorkUnit +// MockWorkUnitMockRecorder is the mock recorder for MockWorkUnit. type MockWorkUnitMockRecorder struct { mock *MockWorkUnit } -// NewMockWorkUnit creates a new mock instance +// NewMockWorkUnit creates a new mock instance. func NewMockWorkUnit(ctrl *gomock.Controller) *MockWorkUnit { mock := &MockWorkUnit{ctrl: ctrl} mock.recorder = &MockWorkUnitMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockWorkUnit) EXPECT() *MockWorkUnitMockRecorder { return m.recorder } -// ID mocks base method +// Cancel mocks base method. +func (m *MockWorkUnit) Cancel() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cancel") + ret0, _ := ret[0].(error) + return ret0 +} + +// Cancel indicates an expected call of Cancel. +func (mr *MockWorkUnitMockRecorder) Cancel() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cancel", reflect.TypeOf((*MockWorkUnit)(nil).Cancel)) +} + +// ID mocks base method. func (m *MockWorkUnit) ID() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ID") @@ -41,83 +62,83 @@ func (m *MockWorkUnit) ID() string { return ret0 } -// ID indicates an expected call of ID +// ID indicates an expected call of ID. func (mr *MockWorkUnitMockRecorder) ID() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockWorkUnit)(nil).ID)) } -// UnitDir mocks base method -func (m *MockWorkUnit) UnitDir() string { +// LastUpdateError mocks base method. +func (m *MockWorkUnit) LastUpdateError() error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UnitDir") - ret0, _ := ret[0].(string) + ret := m.ctrl.Call(m, "LastUpdateError") + ret0, _ := ret[0].(error) return ret0 } -// UnitDir indicates an expected call of UnitDir -func (mr *MockWorkUnitMockRecorder) UnitDir() *gomock.Call { +// LastUpdateError indicates an expected call of LastUpdateError. +func (mr *MockWorkUnitMockRecorder) LastUpdateError() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnitDir", reflect.TypeOf((*MockWorkUnit)(nil).UnitDir)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastUpdateError", reflect.TypeOf((*MockWorkUnit)(nil).LastUpdateError)) } -// StatusFileName mocks base method -func (m *MockWorkUnit) StatusFileName() string { +// Load mocks base method. +func (m *MockWorkUnit) Load() error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StatusFileName") - ret0, _ := ret[0].(string) + ret := m.ctrl.Call(m, "Load") + ret0, _ := ret[0].(error) return ret0 } -// StatusFileName indicates an expected call of StatusFileName -func (mr *MockWorkUnitMockRecorder) StatusFileName() *gomock.Call { +// Load indicates an expected call of Load. +func (mr *MockWorkUnitMockRecorder) Load() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StatusFileName", reflect.TypeOf((*MockWorkUnit)(nil).StatusFileName)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Load", reflect.TypeOf((*MockWorkUnit)(nil).Load)) } -// StdoutFileName mocks base method -func (m *MockWorkUnit) StdoutFileName() string { +// Release mocks base method. +func (m *MockWorkUnit) Release(force bool) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StdoutFileName") - ret0, _ := ret[0].(string) + ret := m.ctrl.Call(m, "Release", force) + ret0, _ := ret[0].(error) return ret0 } -// StdoutFileName indicates an expected call of StdoutFileName -func (mr *MockWorkUnitMockRecorder) StdoutFileName() *gomock.Call { +// Release indicates an expected call of Release. +func (mr *MockWorkUnitMockRecorder) Release(force any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StdoutFileName", reflect.TypeOf((*MockWorkUnit)(nil).StdoutFileName)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Release", reflect.TypeOf((*MockWorkUnit)(nil).Release), force) } -// Save mocks base method -func (m *MockWorkUnit) Save() error { +// Restart mocks base method. +func (m *MockWorkUnit) Restart() error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Save") + ret := m.ctrl.Call(m, "Restart") ret0, _ := ret[0].(error) return ret0 } -// Save indicates an expected call of Save -func (mr *MockWorkUnitMockRecorder) Save() *gomock.Call { +// Restart indicates an expected call of Restart. +func (mr *MockWorkUnitMockRecorder) Restart() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Save", reflect.TypeOf((*MockWorkUnit)(nil).Save)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Restart", reflect.TypeOf((*MockWorkUnit)(nil).Restart)) } -// Load mocks base method -func (m *MockWorkUnit) Load() error { +// Save mocks base method. +func (m *MockWorkUnit) Save() error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Load") + ret := m.ctrl.Call(m, "Save") ret0, _ := ret[0].(error) return ret0 } -// Load indicates an expected call of Load -func (mr *MockWorkUnitMockRecorder) Load() *gomock.Call { +// Save indicates an expected call of Save. +func (mr *MockWorkUnitMockRecorder) Save() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Load", reflect.TypeOf((*MockWorkUnit)(nil).Load)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Save", reflect.TypeOf((*MockWorkUnit)(nil).Save)) } -// SetFromParams mocks base method +// SetFromParams mocks base method. func (m *MockWorkUnit) SetFromParams(params map[string]string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SetFromParams", params) @@ -125,51 +146,27 @@ func (m *MockWorkUnit) SetFromParams(params map[string]string) error { return ret0 } -// SetFromParams indicates an expected call of SetFromParams -func (mr *MockWorkUnitMockRecorder) SetFromParams(params interface{}) *gomock.Call { +// SetFromParams indicates an expected call of SetFromParams. +func (mr *MockWorkUnitMockRecorder) SetFromParams(params any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetFromParams", reflect.TypeOf((*MockWorkUnit)(nil).SetFromParams), params) } -// UpdateBasicStatus mocks base method -func (m *MockWorkUnit) UpdateBasicStatus(state int, detail string, stdoutSize int64) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "UpdateBasicStatus", state, detail, stdoutSize) -} - -// UpdateBasicStatus indicates an expected call of UpdateBasicStatus -func (mr *MockWorkUnitMockRecorder) UpdateBasicStatus(state, detail, stdoutSize interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBasicStatus", reflect.TypeOf((*MockWorkUnit)(nil).UpdateBasicStatus), state, detail, stdoutSize) -} - -// UpdateFullStatus mocks base method -func (m *MockWorkUnit) UpdateFullStatus(statusFunc func(*workceptor.StatusFileData)) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "UpdateFullStatus", statusFunc) -} - -// UpdateFullStatus indicates an expected call of UpdateFullStatus -func (mr *MockWorkUnitMockRecorder) UpdateFullStatus(statusFunc interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateFullStatus", reflect.TypeOf((*MockWorkUnit)(nil).UpdateFullStatus), statusFunc) -} - -// LastUpdateError mocks base method -func (m *MockWorkUnit) LastUpdateError() error { +// Start mocks base method. +func (m *MockWorkUnit) Start() error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LastUpdateError") + ret := m.ctrl.Call(m, "Start") ret0, _ := ret[0].(error) return ret0 } -// LastUpdateError indicates an expected call of LastUpdateError -func (mr *MockWorkUnitMockRecorder) LastUpdateError() *gomock.Call { +// Start indicates an expected call of Start. +func (mr *MockWorkUnitMockRecorder) Start() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastUpdateError", reflect.TypeOf((*MockWorkUnit)(nil).LastUpdateError)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockWorkUnit)(nil).Start)) } -// Status mocks base method +// Status mocks base method. func (m *MockWorkUnit) Status() *workceptor.StatusFileData { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Status") @@ -177,143 +174,154 @@ func (m *MockWorkUnit) Status() *workceptor.StatusFileData { return ret0 } -// Status indicates an expected call of Status +// Status indicates an expected call of Status. func (mr *MockWorkUnitMockRecorder) Status() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Status", reflect.TypeOf((*MockWorkUnit)(nil).Status)) } -// UnredactedStatus mocks base method -func (m *MockWorkUnit) UnredactedStatus() *workceptor.StatusFileData { +// StatusFileName mocks base method. +func (m *MockWorkUnit) StatusFileName() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UnredactedStatus") - ret0, _ := ret[0].(*workceptor.StatusFileData) + ret := m.ctrl.Call(m, "StatusFileName") + ret0, _ := ret[0].(string) return ret0 } -// UnredactedStatus indicates an expected call of UnredactedStatus -func (mr *MockWorkUnitMockRecorder) UnredactedStatus() *gomock.Call { +// StatusFileName indicates an expected call of StatusFileName. +func (mr *MockWorkUnitMockRecorder) StatusFileName() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnredactedStatus", reflect.TypeOf((*MockWorkUnit)(nil).UnredactedStatus)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StatusFileName", reflect.TypeOf((*MockWorkUnit)(nil).StatusFileName)) } -// Start mocks base method -func (m *MockWorkUnit) Start() error { +// StdoutFileName mocks base method. +func (m *MockWorkUnit) StdoutFileName() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Start") - ret0, _ := ret[0].(error) + ret := m.ctrl.Call(m, "StdoutFileName") + ret0, _ := ret[0].(string) return ret0 } -// Start indicates an expected call of Start -func (mr *MockWorkUnitMockRecorder) Start() *gomock.Call { +// StdoutFileName indicates an expected call of StdoutFileName. +func (mr *MockWorkUnitMockRecorder) StdoutFileName() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockWorkUnit)(nil).Start)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StdoutFileName", reflect.TypeOf((*MockWorkUnit)(nil).StdoutFileName)) } -// Restart mocks base method -func (m *MockWorkUnit) Restart() error { +// UnitDir mocks base method. +func (m *MockWorkUnit) UnitDir() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Restart") - ret0, _ := ret[0].(error) + ret := m.ctrl.Call(m, "UnitDir") + ret0, _ := ret[0].(string) return ret0 } -// Restart indicates an expected call of Restart -func (mr *MockWorkUnitMockRecorder) Restart() *gomock.Call { +// UnitDir indicates an expected call of UnitDir. +func (mr *MockWorkUnitMockRecorder) UnitDir() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Restart", reflect.TypeOf((*MockWorkUnit)(nil).Restart)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnitDir", reflect.TypeOf((*MockWorkUnit)(nil).UnitDir)) } -// Cancel mocks base method -func (m *MockWorkUnit) Cancel() error { +// UnredactedStatus mocks base method. +func (m *MockWorkUnit) UnredactedStatus() *workceptor.StatusFileData { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Cancel") - ret0, _ := ret[0].(error) + ret := m.ctrl.Call(m, "UnredactedStatus") + ret0, _ := ret[0].(*workceptor.StatusFileData) return ret0 } -// Cancel indicates an expected call of Cancel -func (mr *MockWorkUnitMockRecorder) Cancel() *gomock.Call { +// UnredactedStatus indicates an expected call of UnredactedStatus. +func (mr *MockWorkUnitMockRecorder) UnredactedStatus() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cancel", reflect.TypeOf((*MockWorkUnit)(nil).Cancel)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnredactedStatus", reflect.TypeOf((*MockWorkUnit)(nil).UnredactedStatus)) } -// Release mocks base method -func (m *MockWorkUnit) Release(force bool) error { +// UpdateBasicStatus mocks base method. +func (m *MockWorkUnit) UpdateBasicStatus(state int, detail string, stdoutSize int64) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Release", force) - ret0, _ := ret[0].(error) - return ret0 + m.ctrl.Call(m, "UpdateBasicStatus", state, detail, stdoutSize) } -// Release indicates an expected call of Release -func (mr *MockWorkUnitMockRecorder) Release(force interface{}) *gomock.Call { +// UpdateBasicStatus indicates an expected call of UpdateBasicStatus. +func (mr *MockWorkUnitMockRecorder) UpdateBasicStatus(state, detail, stdoutSize any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Release", reflect.TypeOf((*MockWorkUnit)(nil).Release), force) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBasicStatus", reflect.TypeOf((*MockWorkUnit)(nil).UpdateBasicStatus), state, detail, stdoutSize) +} + +// UpdateFullStatus mocks base method. +func (m *MockWorkUnit) UpdateFullStatus(statusFunc func(*workceptor.StatusFileData)) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "UpdateFullStatus", statusFunc) +} + +// UpdateFullStatus indicates an expected call of UpdateFullStatus. +func (mr *MockWorkUnitMockRecorder) UpdateFullStatus(statusFunc any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateFullStatus", reflect.TypeOf((*MockWorkUnit)(nil).UpdateFullStatus), statusFunc) } -// MockWorkerConfig is a mock of WorkerConfig interface +// MockWorkerConfig is a mock of WorkerConfig interface. type MockWorkerConfig struct { ctrl *gomock.Controller recorder *MockWorkerConfigMockRecorder + isgomock struct{} } -// MockWorkerConfigMockRecorder is the mock recorder for MockWorkerConfig +// MockWorkerConfigMockRecorder is the mock recorder for MockWorkerConfig. type MockWorkerConfigMockRecorder struct { mock *MockWorkerConfig } -// NewMockWorkerConfig creates a new mock instance +// NewMockWorkerConfig creates a new mock instance. func NewMockWorkerConfig(ctrl *gomock.Controller) *MockWorkerConfig { mock := &MockWorkerConfig{ctrl: ctrl} mock.recorder = &MockWorkerConfigMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockWorkerConfig) EXPECT() *MockWorkerConfigMockRecorder { return m.recorder } -// GetWorkType mocks base method -func (m *MockWorkerConfig) GetWorkType() string { +// GetVerifySignature mocks base method. +func (m *MockWorkerConfig) GetVerifySignature() bool { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetWorkType") - ret0, _ := ret[0].(string) + ret := m.ctrl.Call(m, "GetVerifySignature") + ret0, _ := ret[0].(bool) return ret0 } -// GetWorkType indicates an expected call of GetWorkType -func (mr *MockWorkerConfigMockRecorder) GetWorkType() *gomock.Call { +// GetVerifySignature indicates an expected call of GetVerifySignature. +func (mr *MockWorkerConfigMockRecorder) GetVerifySignature() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkType", reflect.TypeOf((*MockWorkerConfig)(nil).GetWorkType)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVerifySignature", reflect.TypeOf((*MockWorkerConfig)(nil).GetVerifySignature)) } -// GetVerifySignature mocks base method -func (m *MockWorkerConfig) GetVerifySignature() bool { +// GetWorkType mocks base method. +func (m *MockWorkerConfig) GetWorkType() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetVerifySignature") - ret0, _ := ret[0].(bool) + ret := m.ctrl.Call(m, "GetWorkType") + ret0, _ := ret[0].(string) return ret0 } -// GetVerifySignature indicates an expected call of GetVerifySignature -func (mr *MockWorkerConfigMockRecorder) GetVerifySignature() *gomock.Call { +// GetWorkType indicates an expected call of GetWorkType. +func (mr *MockWorkerConfigMockRecorder) GetWorkType() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVerifySignature", reflect.TypeOf((*MockWorkerConfig)(nil).GetVerifySignature)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkType", reflect.TypeOf((*MockWorkerConfig)(nil).GetWorkType)) } -// NewWorker mocks base method -func (m *MockWorkerConfig) NewWorker(w *workceptor.Workceptor, unitID, workType string) workceptor.WorkUnit { +// NewWorker mocks base method. +func (m *MockWorkerConfig) NewWorker(bwu workceptor.BaseWorkUnitForWorkUnit, w *workceptor.Workceptor, unitID, workType string) workceptor.WorkUnit { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewWorker", w, unitID, workType) + ret := m.ctrl.Call(m, "NewWorker", bwu, w, unitID, workType) ret0, _ := ret[0].(workceptor.WorkUnit) return ret0 } -// NewWorker indicates an expected call of NewWorker -func (mr *MockWorkerConfigMockRecorder) NewWorker(w, unitID, workType interface{}) *gomock.Call { +// NewWorker indicates an expected call of NewWorker. +func (mr *MockWorkerConfigMockRecorder) NewWorker(bwu, w, unitID, workType any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewWorker", reflect.TypeOf((*MockWorkerConfig)(nil).NewWorker), w, unitID, workType) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewWorker", reflect.TypeOf((*MockWorkerConfig)(nil).NewWorker), bwu, w, unitID, workType) } diff --git a/pkg/workceptor/mock_workceptor/kubernetes.go b/pkg/workceptor/mock_workceptor/kubernetes.go index f72746955..3de73ea92 100644 --- a/pkg/workceptor/mock_workceptor/kubernetes.go +++ b/pkg/workceptor/mock_workceptor/kubernetes.go @@ -1,12 +1,20 @@ // Code generated by MockGen. DO NOT EDIT. // Source: pkg/workceptor/kubernetes.go +// +// Generated by this command: +// +// mockgen -source=pkg/workceptor/kubernetes.go -destination=pkg/workceptor/mock_workceptor/kubernetes.go +// // Package mock_workceptor is a generated GoMock package. package mock_workceptor import ( context "context" - gomock "github.com/golang/mock/gomock" + url "net/url" + reflect "reflect" + + gomock "go.uber.org/mock/gomock" v1 "k8s.io/api/core/v1" errors "k8s.io/apimachinery/pkg/api/errors" v10 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -21,91 +29,77 @@ import ( remotecommand "k8s.io/client-go/tools/remotecommand" watch0 "k8s.io/client-go/tools/watch" flowcontrol "k8s.io/client-go/util/flowcontrol" - url "net/url" - reflect "reflect" ) -// MockKubeAPIer is a mock of KubeAPIer interface +// MockKubeAPIer is a mock of KubeAPIer interface. type MockKubeAPIer struct { ctrl *gomock.Controller recorder *MockKubeAPIerMockRecorder + isgomock struct{} } -// MockKubeAPIerMockRecorder is the mock recorder for MockKubeAPIer +// MockKubeAPIerMockRecorder is the mock recorder for MockKubeAPIer. type MockKubeAPIerMockRecorder struct { mock *MockKubeAPIer } -// NewMockKubeAPIer creates a new mock instance +// NewMockKubeAPIer creates a new mock instance. func NewMockKubeAPIer(ctrl *gomock.Controller) *MockKubeAPIer { mock := &MockKubeAPIer{ctrl: ctrl} mock.recorder = &MockKubeAPIerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockKubeAPIer) EXPECT() *MockKubeAPIerMockRecorder { return m.recorder } -// NewNotFound mocks base method -func (m *MockKubeAPIer) NewNotFound(arg0 schema.GroupResource, arg1 string) *errors.StatusError { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewNotFound", arg0, arg1) - ret0, _ := ret[0].(*errors.StatusError) - return ret0 -} - -// NewNotFound indicates an expected call of NewNotFound -func (mr *MockKubeAPIerMockRecorder) NewNotFound(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewNotFound", reflect.TypeOf((*MockKubeAPIer)(nil).NewNotFound), arg0, arg1) -} - -// OneTermEqualSelector mocks base method -func (m *MockKubeAPIer) OneTermEqualSelector(arg0, arg1 string) fields.Selector { +// BuildConfigFromFlags mocks base method. +func (m *MockKubeAPIer) BuildConfigFromFlags(arg0, arg1 string) (*rest.Config, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OneTermEqualSelector", arg0, arg1) - ret0, _ := ret[0].(fields.Selector) - return ret0 + ret := m.ctrl.Call(m, "BuildConfigFromFlags", arg0, arg1) + ret0, _ := ret[0].(*rest.Config) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// OneTermEqualSelector indicates an expected call of OneTermEqualSelector -func (mr *MockKubeAPIerMockRecorder) OneTermEqualSelector(arg0, arg1 interface{}) *gomock.Call { +// BuildConfigFromFlags indicates an expected call of BuildConfigFromFlags. +func (mr *MockKubeAPIerMockRecorder) BuildConfigFromFlags(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OneTermEqualSelector", reflect.TypeOf((*MockKubeAPIer)(nil).OneTermEqualSelector), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildConfigFromFlags", reflect.TypeOf((*MockKubeAPIer)(nil).BuildConfigFromFlags), arg0, arg1) } -// NewForConfig mocks base method -func (m *MockKubeAPIer) NewForConfig(arg0 *rest.Config) (*kubernetes.Clientset, error) { +// Create mocks base method. +func (m *MockKubeAPIer) Create(arg0 context.Context, arg1 *kubernetes.Clientset, arg2 string, arg3 *v1.Pod, arg4 v10.CreateOptions) (*v1.Pod, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewForConfig", arg0) - ret0, _ := ret[0].(*kubernetes.Clientset) + ret := m.ctrl.Call(m, "Create", arg0, arg1, arg2, arg3, arg4) + ret0, _ := ret[0].(*v1.Pod) ret1, _ := ret[1].(error) return ret0, ret1 } -// NewForConfig indicates an expected call of NewForConfig -func (mr *MockKubeAPIerMockRecorder) NewForConfig(arg0 interface{}) *gomock.Call { +// Create indicates an expected call of Create. +func (mr *MockKubeAPIerMockRecorder) Create(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewForConfig", reflect.TypeOf((*MockKubeAPIer)(nil).NewForConfig), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockKubeAPIer)(nil).Create), arg0, arg1, arg2, arg3, arg4) } -// GetLogs mocks base method -func (m *MockKubeAPIer) GetLogs(arg0 *kubernetes.Clientset, arg1, arg2 string, arg3 *v1.PodLogOptions) *rest.Request { +// Delete mocks base method. +func (m *MockKubeAPIer) Delete(arg0 context.Context, arg1 *kubernetes.Clientset, arg2, arg3 string, arg4 v10.DeleteOptions) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetLogs", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*rest.Request) + ret := m.ctrl.Call(m, "Delete", arg0, arg1, arg2, arg3, arg4) + ret0, _ := ret[0].(error) return ret0 } -// GetLogs indicates an expected call of GetLogs -func (mr *MockKubeAPIerMockRecorder) GetLogs(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +// Delete indicates an expected call of Delete. +func (mr *MockKubeAPIerMockRecorder) Delete(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogs", reflect.TypeOf((*MockKubeAPIer)(nil).GetLogs), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockKubeAPIer)(nil).Delete), arg0, arg1, arg2, arg3, arg4) } -// Get mocks base method +// Get mocks base method. func (m *MockKubeAPIer) Get(arg0 context.Context, arg1 *kubernetes.Clientset, arg2, arg3 string, arg4 v10.GetOptions) (*v1.Pod, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Get", arg0, arg1, arg2, arg3, arg4) @@ -114,28 +108,42 @@ func (m *MockKubeAPIer) Get(arg0 context.Context, arg1 *kubernetes.Clientset, ar return ret0, ret1 } -// Get indicates an expected call of Get -func (mr *MockKubeAPIerMockRecorder) Get(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +// Get indicates an expected call of Get. +func (mr *MockKubeAPIerMockRecorder) Get(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockKubeAPIer)(nil).Get), arg0, arg1, arg2, arg3, arg4) } -// Create mocks base method -func (m *MockKubeAPIer) Create(arg0 context.Context, arg1 *kubernetes.Clientset, arg2 string, arg3 *v1.Pod, arg4 v10.CreateOptions) (*v1.Pod, error) { +// GetLogs mocks base method. +func (m *MockKubeAPIer) GetLogs(arg0 *kubernetes.Clientset, arg1, arg2 string, arg3 *v1.PodLogOptions) *rest.Request { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].(*v1.Pod) + ret := m.ctrl.Call(m, "GetLogs", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(*rest.Request) + return ret0 +} + +// GetLogs indicates an expected call of GetLogs. +func (mr *MockKubeAPIerMockRecorder) GetLogs(arg0, arg1, arg2, arg3 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogs", reflect.TypeOf((*MockKubeAPIer)(nil).GetLogs), arg0, arg1, arg2, arg3) +} + +// InClusterConfig mocks base method. +func (m *MockKubeAPIer) InClusterConfig() (*rest.Config, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "InClusterConfig") + ret0, _ := ret[0].(*rest.Config) ret1, _ := ret[1].(error) return ret0, ret1 } -// Create indicates an expected call of Create -func (mr *MockKubeAPIerMockRecorder) Create(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +// InClusterConfig indicates an expected call of InClusterConfig. +func (mr *MockKubeAPIerMockRecorder) InClusterConfig() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockKubeAPIer)(nil).Create), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InClusterConfig", reflect.TypeOf((*MockKubeAPIer)(nil).InClusterConfig)) } -// List mocks base method +// List mocks base method. func (m *MockKubeAPIer) List(arg0 context.Context, arg1 *kubernetes.Clientset, arg2 string, arg3 v10.ListOptions) (*v1.PodList, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "List", arg0, arg1, arg2, arg3) @@ -144,115 +152,99 @@ func (m *MockKubeAPIer) List(arg0 context.Context, arg1 *kubernetes.Clientset, a return ret0, ret1 } -// List indicates an expected call of List -func (mr *MockKubeAPIerMockRecorder) List(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +// List indicates an expected call of List. +func (mr *MockKubeAPIerMockRecorder) List(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockKubeAPIer)(nil).List), arg0, arg1, arg2, arg3) } -// Watch mocks base method -func (m *MockKubeAPIer) Watch(arg0 context.Context, arg1 *kubernetes.Clientset, arg2 string, arg3 v10.ListOptions) (watch.Interface, error) { +// NewClientConfigFromBytes mocks base method. +func (m *MockKubeAPIer) NewClientConfigFromBytes(arg0 []byte) (clientcmd.ClientConfig, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Watch", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(watch.Interface) + ret := m.ctrl.Call(m, "NewClientConfigFromBytes", arg0) + ret0, _ := ret[0].(clientcmd.ClientConfig) ret1, _ := ret[1].(error) return ret0, ret1 } -// Watch indicates an expected call of Watch -func (mr *MockKubeAPIerMockRecorder) Watch(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +// NewClientConfigFromBytes indicates an expected call of NewClientConfigFromBytes. +func (mr *MockKubeAPIerMockRecorder) NewClientConfigFromBytes(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Watch", reflect.TypeOf((*MockKubeAPIer)(nil).Watch), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewClientConfigFromBytes", reflect.TypeOf((*MockKubeAPIer)(nil).NewClientConfigFromBytes), arg0) } -// Delete mocks base method -func (m *MockKubeAPIer) Delete(arg0 context.Context, arg1 *kubernetes.Clientset, arg2, arg3 string, arg4 v10.DeleteOptions) error { +// NewDefaultClientConfigLoadingRules mocks base method. +func (m *MockKubeAPIer) NewDefaultClientConfigLoadingRules() *clientcmd.ClientConfigLoadingRules { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1, arg2, arg3, arg4) - ret0, _ := ret[0].(error) + ret := m.ctrl.Call(m, "NewDefaultClientConfigLoadingRules") + ret0, _ := ret[0].(*clientcmd.ClientConfigLoadingRules) return ret0 } -// Delete indicates an expected call of Delete -func (mr *MockKubeAPIerMockRecorder) Delete(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { +// NewDefaultClientConfigLoadingRules indicates an expected call of NewDefaultClientConfigLoadingRules. +func (mr *MockKubeAPIerMockRecorder) NewDefaultClientConfigLoadingRules() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockKubeAPIer)(nil).Delete), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewDefaultClientConfigLoadingRules", reflect.TypeOf((*MockKubeAPIer)(nil).NewDefaultClientConfigLoadingRules)) } -// SubResource mocks base method -func (m *MockKubeAPIer) SubResource(arg0 *kubernetes.Clientset, arg1, arg2 string) *rest.Request { +// NewFakeAlwaysRateLimiter mocks base method. +func (m *MockKubeAPIer) NewFakeAlwaysRateLimiter() flowcontrol.RateLimiter { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SubResource", arg0, arg1, arg2) - ret0, _ := ret[0].(*rest.Request) + ret := m.ctrl.Call(m, "NewFakeAlwaysRateLimiter") + ret0, _ := ret[0].(flowcontrol.RateLimiter) return ret0 } -// SubResource indicates an expected call of SubResource -func (mr *MockKubeAPIerMockRecorder) SubResource(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubResource", reflect.TypeOf((*MockKubeAPIer)(nil).SubResource), arg0, arg1, arg2) -} - -// InClusterConfig mocks base method -func (m *MockKubeAPIer) InClusterConfig() (*rest.Config, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InClusterConfig") - ret0, _ := ret[0].(*rest.Config) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// InClusterConfig indicates an expected call of InClusterConfig -func (mr *MockKubeAPIerMockRecorder) InClusterConfig() *gomock.Call { +// NewFakeAlwaysRateLimiter indicates an expected call of NewFakeAlwaysRateLimiter. +func (mr *MockKubeAPIerMockRecorder) NewFakeAlwaysRateLimiter() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InClusterConfig", reflect.TypeOf((*MockKubeAPIer)(nil).InClusterConfig)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewFakeAlwaysRateLimiter", reflect.TypeOf((*MockKubeAPIer)(nil).NewFakeAlwaysRateLimiter)) } -// NewDefaultClientConfigLoadingRules mocks base method -func (m *MockKubeAPIer) NewDefaultClientConfigLoadingRules() *clientcmd.ClientConfigLoadingRules { +// NewFakeNeverRateLimiter mocks base method. +func (m *MockKubeAPIer) NewFakeNeverRateLimiter() flowcontrol.RateLimiter { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewDefaultClientConfigLoadingRules") - ret0, _ := ret[0].(*clientcmd.ClientConfigLoadingRules) + ret := m.ctrl.Call(m, "NewFakeNeverRateLimiter") + ret0, _ := ret[0].(flowcontrol.RateLimiter) return ret0 } -// NewDefaultClientConfigLoadingRules indicates an expected call of NewDefaultClientConfigLoadingRules -func (mr *MockKubeAPIerMockRecorder) NewDefaultClientConfigLoadingRules() *gomock.Call { +// NewFakeNeverRateLimiter indicates an expected call of NewFakeNeverRateLimiter. +func (mr *MockKubeAPIerMockRecorder) NewFakeNeverRateLimiter() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewDefaultClientConfigLoadingRules", reflect.TypeOf((*MockKubeAPIer)(nil).NewDefaultClientConfigLoadingRules)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewFakeNeverRateLimiter", reflect.TypeOf((*MockKubeAPIer)(nil).NewFakeNeverRateLimiter)) } -// BuildConfigFromFlags mocks base method -func (m *MockKubeAPIer) BuildConfigFromFlags(arg0, arg1 string) (*rest.Config, error) { +// NewForConfig mocks base method. +func (m *MockKubeAPIer) NewForConfig(arg0 *rest.Config) (*kubernetes.Clientset, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BuildConfigFromFlags", arg0, arg1) - ret0, _ := ret[0].(*rest.Config) + ret := m.ctrl.Call(m, "NewForConfig", arg0) + ret0, _ := ret[0].(*kubernetes.Clientset) ret1, _ := ret[1].(error) return ret0, ret1 } -// BuildConfigFromFlags indicates an expected call of BuildConfigFromFlags -func (mr *MockKubeAPIerMockRecorder) BuildConfigFromFlags(arg0, arg1 interface{}) *gomock.Call { +// NewForConfig indicates an expected call of NewForConfig. +func (mr *MockKubeAPIerMockRecorder) NewForConfig(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildConfigFromFlags", reflect.TypeOf((*MockKubeAPIer)(nil).BuildConfigFromFlags), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewForConfig", reflect.TypeOf((*MockKubeAPIer)(nil).NewForConfig), arg0) } -// NewClientConfigFromBytes mocks base method -func (m *MockKubeAPIer) NewClientConfigFromBytes(arg0 []byte) (clientcmd.ClientConfig, error) { +// NewNotFound mocks base method. +func (m *MockKubeAPIer) NewNotFound(arg0 schema.GroupResource, arg1 string) *errors.StatusError { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewClientConfigFromBytes", arg0) - ret0, _ := ret[0].(clientcmd.ClientConfig) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret := m.ctrl.Call(m, "NewNotFound", arg0, arg1) + ret0, _ := ret[0].(*errors.StatusError) + return ret0 } -// NewClientConfigFromBytes indicates an expected call of NewClientConfigFromBytes -func (mr *MockKubeAPIerMockRecorder) NewClientConfigFromBytes(arg0 interface{}) *gomock.Call { +// NewNotFound indicates an expected call of NewNotFound. +func (mr *MockKubeAPIerMockRecorder) NewNotFound(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewClientConfigFromBytes", reflect.TypeOf((*MockKubeAPIer)(nil).NewClientConfigFromBytes), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewNotFound", reflect.TypeOf((*MockKubeAPIer)(nil).NewNotFound), arg0, arg1) } -// NewSPDYExecutor mocks base method +// NewSPDYExecutor mocks base method. func (m *MockKubeAPIer) NewSPDYExecutor(arg0 *rest.Config, arg1 string, arg2 *url.URL) (remotecommand.Executor, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NewSPDYExecutor", arg0, arg1, arg2) @@ -261,13 +253,27 @@ func (m *MockKubeAPIer) NewSPDYExecutor(arg0 *rest.Config, arg1 string, arg2 *ur return ret0, ret1 } -// NewSPDYExecutor indicates an expected call of NewSPDYExecutor -func (mr *MockKubeAPIerMockRecorder) NewSPDYExecutor(arg0, arg1, arg2 interface{}) *gomock.Call { +// NewSPDYExecutor indicates an expected call of NewSPDYExecutor. +func (mr *MockKubeAPIerMockRecorder) NewSPDYExecutor(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewSPDYExecutor", reflect.TypeOf((*MockKubeAPIer)(nil).NewSPDYExecutor), arg0, arg1, arg2) } -// StreamWithContext mocks base method +// OneTermEqualSelector mocks base method. +func (m *MockKubeAPIer) OneTermEqualSelector(arg0, arg1 string) fields.Selector { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OneTermEqualSelector", arg0, arg1) + ret0, _ := ret[0].(fields.Selector) + return ret0 +} + +// OneTermEqualSelector indicates an expected call of OneTermEqualSelector. +func (mr *MockKubeAPIerMockRecorder) OneTermEqualSelector(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OneTermEqualSelector", reflect.TypeOf((*MockKubeAPIer)(nil).OneTermEqualSelector), arg0, arg1) +} + +// StreamWithContext mocks base method. func (m *MockKubeAPIer) StreamWithContext(arg0 context.Context, arg1 remotecommand.Executor, arg2 remotecommand.StreamOptions) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StreamWithContext", arg0, arg1, arg2) @@ -275,16 +281,30 @@ func (m *MockKubeAPIer) StreamWithContext(arg0 context.Context, arg1 remotecomma return ret0 } -// StreamWithContext indicates an expected call of StreamWithContext -func (mr *MockKubeAPIerMockRecorder) StreamWithContext(arg0, arg1, arg2 interface{}) *gomock.Call { +// StreamWithContext indicates an expected call of StreamWithContext. +func (mr *MockKubeAPIerMockRecorder) StreamWithContext(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamWithContext", reflect.TypeOf((*MockKubeAPIer)(nil).StreamWithContext), arg0, arg1, arg2) } -// UntilWithSync mocks base method +// SubResource mocks base method. +func (m *MockKubeAPIer) SubResource(arg0 *kubernetes.Clientset, arg1, arg2 string) *rest.Request { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SubResource", arg0, arg1, arg2) + ret0, _ := ret[0].(*rest.Request) + return ret0 +} + +// SubResource indicates an expected call of SubResource. +func (mr *MockKubeAPIerMockRecorder) SubResource(arg0, arg1, arg2 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubResource", reflect.TypeOf((*MockKubeAPIer)(nil).SubResource), arg0, arg1, arg2) +} + +// UntilWithSync mocks base method. func (m *MockKubeAPIer) UntilWithSync(arg0 context.Context, arg1 cache.ListerWatcher, arg2 runtime.Object, arg3 watch0.PreconditionFunc, arg4 ...watch0.ConditionFunc) (*watch.Event, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1, arg2, arg3} + varargs := []any{arg0, arg1, arg2, arg3} for _, a := range arg4 { varargs = append(varargs, a) } @@ -294,37 +314,24 @@ func (m *MockKubeAPIer) UntilWithSync(arg0 context.Context, arg1 cache.ListerWat return ret0, ret1 } -// UntilWithSync indicates an expected call of UntilWithSync -func (mr *MockKubeAPIerMockRecorder) UntilWithSync(arg0, arg1, arg2, arg3 interface{}, arg4 ...interface{}) *gomock.Call { +// UntilWithSync indicates an expected call of UntilWithSync. +func (mr *MockKubeAPIerMockRecorder) UntilWithSync(arg0, arg1, arg2, arg3 any, arg4 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1, arg2, arg3}, arg4...) + varargs := append([]any{arg0, arg1, arg2, arg3}, arg4...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UntilWithSync", reflect.TypeOf((*MockKubeAPIer)(nil).UntilWithSync), varargs...) } -// NewFakeNeverRateLimiter mocks base method -func (m *MockKubeAPIer) NewFakeNeverRateLimiter() flowcontrol.RateLimiter { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewFakeNeverRateLimiter") - ret0, _ := ret[0].(flowcontrol.RateLimiter) - return ret0 -} - -// NewFakeNeverRateLimiter indicates an expected call of NewFakeNeverRateLimiter -func (mr *MockKubeAPIerMockRecorder) NewFakeNeverRateLimiter() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewFakeNeverRateLimiter", reflect.TypeOf((*MockKubeAPIer)(nil).NewFakeNeverRateLimiter)) -} - -// NewFakeAlwaysRateLimiter mocks base method -func (m *MockKubeAPIer) NewFakeAlwaysRateLimiter() flowcontrol.RateLimiter { +// Watch mocks base method. +func (m *MockKubeAPIer) Watch(arg0 context.Context, arg1 *kubernetes.Clientset, arg2 string, arg3 v10.ListOptions) (watch.Interface, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewFakeAlwaysRateLimiter") - ret0, _ := ret[0].(flowcontrol.RateLimiter) - return ret0 + ret := m.ctrl.Call(m, "Watch", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(watch.Interface) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// NewFakeAlwaysRateLimiter indicates an expected call of NewFakeAlwaysRateLimiter -func (mr *MockKubeAPIerMockRecorder) NewFakeAlwaysRateLimiter() *gomock.Call { +// Watch indicates an expected call of Watch. +func (mr *MockKubeAPIerMockRecorder) Watch(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewFakeAlwaysRateLimiter", reflect.TypeOf((*MockKubeAPIer)(nil).NewFakeAlwaysRateLimiter)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Watch", reflect.TypeOf((*MockKubeAPIer)(nil).Watch), arg0, arg1, arg2, arg3) } diff --git a/pkg/workceptor/mock_workceptor/server.go b/pkg/workceptor/mock_workceptor/server.go deleted file mode 100644 index 7620bef83..000000000 --- a/pkg/workceptor/mock_workceptor/server.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ansible/receptor/pkg/workceptor (interfaces: ServerForWorkceptor) - -// Package mock_workceptor is a generated GoMock package. -package mock_workceptor - -import ( - context "context" - tls "crypto/tls" - fs "io/fs" - net "net" - reflect "reflect" - - controlsvc "github.com/ansible/receptor/pkg/controlsvc" - gomock "github.com/golang/mock/gomock" -) - -// MockServerForWorkceptor is a mock of ServerForWorkceptor interface. -type MockServerForWorkceptor struct { - ctrl *gomock.Controller - recorder *MockServerForWorkceptorMockRecorder -} - -// MockServerForWorkceptorMockRecorder is the mock recorder for MockServerForWorkceptor. -type MockServerForWorkceptorMockRecorder struct { - mock *MockServerForWorkceptor -} - -// NewMockServerForWorkceptor creates a new mock instance. -func NewMockServerForWorkceptor(ctrl *gomock.Controller) *MockServerForWorkceptor { - mock := &MockServerForWorkceptor{ctrl: ctrl} - mock.recorder = &MockServerForWorkceptorMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockServerForWorkceptor) EXPECT() *MockServerForWorkceptorMockRecorder { - return m.recorder -} - -// AddControlFunc mocks base method. -func (m *MockServerForWorkceptor) AddControlFunc(arg0 string, arg1 controlsvc.ControlCommandType) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AddControlFunc", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// AddControlFunc indicates an expected call of AddControlFunc. -func (mr *MockServerForWorkceptorMockRecorder) AddControlFunc(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddControlFunc", reflect.TypeOf((*MockServerForWorkceptor)(nil).AddControlFunc), arg0, arg1) -} - -// ConnectionListener mocks base method. -func (m *MockServerForWorkceptor) ConnectionListener(arg0 context.Context, arg1 net.Listener) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "ConnectionListener", arg0, arg1) -} - -// ConnectionListener indicates an expected call of ConnectionListener. -func (mr *MockServerForWorkceptorMockRecorder) ConnectionListener(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectionListener", reflect.TypeOf((*MockServerForWorkceptor)(nil).ConnectionListener), arg0, arg1) -} - -// RunControlSession mocks base method. -func (m *MockServerForWorkceptor) RunControlSession(arg0 net.Conn) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "RunControlSession", arg0) -} - -// RunControlSession indicates an expected call of RunControlSession. -func (mr *MockServerForWorkceptorMockRecorder) RunControlSession(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunControlSession", reflect.TypeOf((*MockServerForWorkceptor)(nil).RunControlSession), arg0) -} - -// RunControlSvc mocks base method. -func (m *MockServerForWorkceptor) RunControlSvc(arg0 context.Context, arg1 string, arg2 *tls.Config, arg3 string, arg4 fs.FileMode, arg5 string, arg6 *tls.Config) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RunControlSvc", arg0, arg1, arg2, arg3, arg4, arg5, arg6) - ret0, _ := ret[0].(error) - return ret0 -} - -// RunControlSvc indicates an expected call of RunControlSvc. -func (mr *MockServerForWorkceptorMockRecorder) RunControlSvc(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunControlSvc", reflect.TypeOf((*MockServerForWorkceptor)(nil).RunControlSvc), arg0, arg1, arg2, arg3, arg4, arg5, arg6) -} - -// SetServerNet mocks base method. -func (m *MockServerForWorkceptor) SetServerNet(arg0 controlsvc.Neter) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "SetServerNet", arg0) -} - -// SetServerNet indicates an expected call of SetServerNet. -func (mr *MockServerForWorkceptorMockRecorder) SetServerNet(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetServerNet", reflect.TypeOf((*MockServerForWorkceptor)(nil).SetServerNet), arg0) -} - -// SetServerTLS mocks base method. -func (m *MockServerForWorkceptor) SetServerTLS(arg0 controlsvc.Tlser) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "SetServerTLS", arg0) -} - -// SetServerTLS indicates an expected call of SetServerTLS. -func (mr *MockServerForWorkceptorMockRecorder) SetServerTLS(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetServerTLS", reflect.TypeOf((*MockServerForWorkceptor)(nil).SetServerTLS), arg0) -} - -// SetServerUtils mocks base method. -func (m *MockServerForWorkceptor) SetServerUtils(arg0 controlsvc.Utiler) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "SetServerUtils", arg0) -} - -// SetServerUtils indicates an expected call of SetServerUtils. -func (mr *MockServerForWorkceptorMockRecorder) SetServerUtils(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetServerUtils", reflect.TypeOf((*MockServerForWorkceptor)(nil).SetServerUtils), arg0) -} - -// SetupConnection mocks base method. -func (m *MockServerForWorkceptor) SetupConnection(arg0 net.Conn) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "SetupConnection", arg0) -} - -// SetupConnection indicates an expected call of SetupConnection. -func (mr *MockServerForWorkceptorMockRecorder) SetupConnection(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetupConnection", reflect.TypeOf((*MockServerForWorkceptor)(nil).SetupConnection), arg0) -} diff --git a/pkg/workceptor/mock_workceptor/stdio_utils.go b/pkg/workceptor/mock_workceptor/stdio_utils.go index 7634027fb..86584bed1 100644 --- a/pkg/workceptor/mock_workceptor/stdio_utils.go +++ b/pkg/workceptor/mock_workceptor/stdio_utils.go @@ -1,84 +1,76 @@ // Code generated by MockGen. DO NOT EDIT. // Source: pkg/workceptor/stdio_utils.go +// +// Generated by this command: +// +// mockgen -source=pkg/workceptor/stdio_utils.go -destination=pkg/workceptor/mock_workceptor/stdio_utils.go +// // Package mock_workceptor is a generated GoMock package. package mock_workceptor import ( - gomock "github.com/golang/mock/gomock" os "os" reflect "reflect" + + gomock "go.uber.org/mock/gomock" ) -// MockFileSystemer is a mock of FileSystemer interface +// MockFileSystemer is a mock of FileSystemer interface. type MockFileSystemer struct { ctrl *gomock.Controller recorder *MockFileSystemerMockRecorder + isgomock struct{} } -// MockFileSystemerMockRecorder is the mock recorder for MockFileSystemer +// MockFileSystemerMockRecorder is the mock recorder for MockFileSystemer. type MockFileSystemerMockRecorder struct { mock *MockFileSystemer } -// NewMockFileSystemer creates a new mock instance +// NewMockFileSystemer creates a new mock instance. func NewMockFileSystemer(ctrl *gomock.Controller) *MockFileSystemer { mock := &MockFileSystemer{ctrl: ctrl} mock.recorder = &MockFileSystemerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockFileSystemer) EXPECT() *MockFileSystemerMockRecorder { return m.recorder } -// OpenFile mocks base method -func (m *MockFileSystemer) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error) { +// Open mocks base method. +func (m *MockFileSystemer) Open(name string) (*os.File, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OpenFile", name, flag, perm) + ret := m.ctrl.Call(m, "Open", name) ret0, _ := ret[0].(*os.File) ret1, _ := ret[1].(error) return ret0, ret1 } -// OpenFile indicates an expected call of OpenFile -func (mr *MockFileSystemerMockRecorder) OpenFile(name, flag, perm interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenFile", reflect.TypeOf((*MockFileSystemer)(nil).OpenFile), name, flag, perm) -} - -// Stat mocks base method -func (m *MockFileSystemer) Stat(name string) (os.FileInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Stat", name) - ret0, _ := ret[0].(os.FileInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Stat indicates an expected call of Stat -func (mr *MockFileSystemerMockRecorder) Stat(name interface{}) *gomock.Call { +// Open indicates an expected call of Open. +func (mr *MockFileSystemerMockRecorder) Open(name any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stat", reflect.TypeOf((*MockFileSystemer)(nil).Stat), name) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Open", reflect.TypeOf((*MockFileSystemer)(nil).Open), name) } -// Open mocks base method -func (m *MockFileSystemer) Open(name string) (*os.File, error) { +// OpenFile mocks base method. +func (m *MockFileSystemer) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Open", name) + ret := m.ctrl.Call(m, "OpenFile", name, flag, perm) ret0, _ := ret[0].(*os.File) ret1, _ := ret[1].(error) return ret0, ret1 } -// Open indicates an expected call of Open -func (mr *MockFileSystemerMockRecorder) Open(name interface{}) *gomock.Call { +// OpenFile indicates an expected call of OpenFile. +func (mr *MockFileSystemerMockRecorder) OpenFile(name, flag, perm any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Open", reflect.TypeOf((*MockFileSystemer)(nil).Open), name) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OpenFile", reflect.TypeOf((*MockFileSystemer)(nil).OpenFile), name, flag, perm) } -// RemoveAll mocks base method +// RemoveAll mocks base method. func (m *MockFileSystemer) RemoveAll(path string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RemoveAll", path) @@ -86,51 +78,52 @@ func (m *MockFileSystemer) RemoveAll(path string) error { return ret0 } -// RemoveAll indicates an expected call of RemoveAll -func (mr *MockFileSystemerMockRecorder) RemoveAll(path interface{}) *gomock.Call { +// RemoveAll indicates an expected call of RemoveAll. +func (mr *MockFileSystemerMockRecorder) RemoveAll(path any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveAll", reflect.TypeOf((*MockFileSystemer)(nil).RemoveAll), path) } -// MockFileWriteCloser is a mock of FileWriteCloser interface +// Stat mocks base method. +func (m *MockFileSystemer) Stat(name string) (os.FileInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Stat", name) + ret0, _ := ret[0].(os.FileInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Stat indicates an expected call of Stat. +func (mr *MockFileSystemerMockRecorder) Stat(name any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stat", reflect.TypeOf((*MockFileSystemer)(nil).Stat), name) +} + +// MockFileWriteCloser is a mock of FileWriteCloser interface. type MockFileWriteCloser struct { ctrl *gomock.Controller recorder *MockFileWriteCloserMockRecorder + isgomock struct{} } -// MockFileWriteCloserMockRecorder is the mock recorder for MockFileWriteCloser +// MockFileWriteCloserMockRecorder is the mock recorder for MockFileWriteCloser. type MockFileWriteCloserMockRecorder struct { mock *MockFileWriteCloser } -// NewMockFileWriteCloser creates a new mock instance +// NewMockFileWriteCloser creates a new mock instance. func NewMockFileWriteCloser(ctrl *gomock.Controller) *MockFileWriteCloser { mock := &MockFileWriteCloser{ctrl: ctrl} mock.recorder = &MockFileWriteCloserMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockFileWriteCloser) EXPECT() *MockFileWriteCloserMockRecorder { return m.recorder } -// Write mocks base method -func (m *MockFileWriteCloser) Write(p []byte) (int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Write", p) - ret0, _ := ret[0].(int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Write indicates an expected call of Write -func (mr *MockFileWriteCloserMockRecorder) Write(p interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockFileWriteCloser)(nil).Write), p) -} - -// Close mocks base method +// Close mocks base method. func (m *MockFileWriteCloser) Close() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Close") @@ -138,51 +131,52 @@ func (m *MockFileWriteCloser) Close() error { return ret0 } -// Close indicates an expected call of Close +// Close indicates an expected call of Close. func (mr *MockFileWriteCloserMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockFileWriteCloser)(nil).Close)) } -// MockFileReadCloser is a mock of FileReadCloser interface +// Write mocks base method. +func (m *MockFileWriteCloser) Write(p []byte) (int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Write", p) + ret0, _ := ret[0].(int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Write indicates an expected call of Write. +func (mr *MockFileWriteCloserMockRecorder) Write(p any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockFileWriteCloser)(nil).Write), p) +} + +// MockFileReadCloser is a mock of FileReadCloser interface. type MockFileReadCloser struct { ctrl *gomock.Controller recorder *MockFileReadCloserMockRecorder + isgomock struct{} } -// MockFileReadCloserMockRecorder is the mock recorder for MockFileReadCloser +// MockFileReadCloserMockRecorder is the mock recorder for MockFileReadCloser. type MockFileReadCloserMockRecorder struct { mock *MockFileReadCloser } -// NewMockFileReadCloser creates a new mock instance +// NewMockFileReadCloser creates a new mock instance. func NewMockFileReadCloser(ctrl *gomock.Controller) *MockFileReadCloser { mock := &MockFileReadCloser{ctrl: ctrl} mock.recorder = &MockFileReadCloserMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockFileReadCloser) EXPECT() *MockFileReadCloserMockRecorder { return m.recorder } -// Read mocks base method -func (m *MockFileReadCloser) Read(p []byte) (int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Read", p) - ret0, _ := ret[0].(int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Read indicates an expected call of Read -func (mr *MockFileReadCloserMockRecorder) Read(p interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockFileReadCloser)(nil).Read), p) -} - -// Close mocks base method +// Close mocks base method. func (m *MockFileReadCloser) Close() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Close") @@ -190,8 +184,23 @@ func (m *MockFileReadCloser) Close() error { return ret0 } -// Close indicates an expected call of Close +// Close indicates an expected call of Close. func (mr *MockFileReadCloserMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockFileReadCloser)(nil).Close)) } + +// Read mocks base method. +func (m *MockFileReadCloser) Read(p []byte) (int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Read", p) + ret0, _ := ret[0].(int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Read indicates an expected call of Read. +func (mr *MockFileReadCloserMockRecorder) Read(p any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockFileReadCloser)(nil).Read), p) +} diff --git a/pkg/workceptor/mock_workceptor/workceptor.go b/pkg/workceptor/mock_workceptor/workceptor.go index e86d0734e..507a8d78a 100644 --- a/pkg/workceptor/mock_workceptor/workceptor.go +++ b/pkg/workceptor/mock_workceptor/workceptor.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: pkg/workceptor/workceptor.go +// +// Generated by this command: +// +// mockgen -source=pkg/workceptor/workceptor.go -destination=pkg/workceptor/mock_workceptor/workceptor.go +// // Package mock_workceptor is a generated GoMock package. package mock_workceptor @@ -7,64 +12,70 @@ package mock_workceptor import ( context "context" tls "crypto/tls" + fs "io/fs" + net "net" + reflect "reflect" + + controlsvc "github.com/ansible/receptor/pkg/controlsvc" logger "github.com/ansible/receptor/pkg/logger" netceptor "github.com/ansible/receptor/pkg/netceptor" - gomock "github.com/golang/mock/gomock" - reflect "reflect" + gomock "go.uber.org/mock/gomock" ) -// MockNetceptorForWorkceptor is a mock of NetceptorForWorkceptor interface +// MockNetceptorForWorkceptor is a mock of NetceptorForWorkceptor interface. type MockNetceptorForWorkceptor struct { ctrl *gomock.Controller recorder *MockNetceptorForWorkceptorMockRecorder + isgomock struct{} } -// MockNetceptorForWorkceptorMockRecorder is the mock recorder for MockNetceptorForWorkceptor +// MockNetceptorForWorkceptorMockRecorder is the mock recorder for MockNetceptorForWorkceptor. type MockNetceptorForWorkceptorMockRecorder struct { mock *MockNetceptorForWorkceptor } -// NewMockNetceptorForWorkceptor creates a new mock instance +// NewMockNetceptorForWorkceptor creates a new mock instance. func NewMockNetceptorForWorkceptor(ctrl *gomock.Controller) *MockNetceptorForWorkceptor { mock := &MockNetceptorForWorkceptor{ctrl: ctrl} mock.recorder = &MockNetceptorForWorkceptorMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockNetceptorForWorkceptor) EXPECT() *MockNetceptorForWorkceptorMockRecorder { return m.recorder } -// NodeID mocks base method -func (m *MockNetceptorForWorkceptor) NodeID() string { +// AddWorkCommand mocks base method. +func (m *MockNetceptorForWorkceptor) AddWorkCommand(typeName string, verifySignature bool) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NodeID") - ret0, _ := ret[0].(string) + ret := m.ctrl.Call(m, "AddWorkCommand", typeName, verifySignature) + ret0, _ := ret[0].(error) return ret0 } -// NodeID indicates an expected call of NodeID -func (mr *MockNetceptorForWorkceptorMockRecorder) NodeID() *gomock.Call { +// AddWorkCommand indicates an expected call of AddWorkCommand. +func (mr *MockNetceptorForWorkceptorMockRecorder) AddWorkCommand(typeName, verifySignature any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeID", reflect.TypeOf((*MockNetceptorForWorkceptor)(nil).NodeID)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddWorkCommand", reflect.TypeOf((*MockNetceptorForWorkceptor)(nil).AddWorkCommand), typeName, verifySignature) } -// AddWorkCommand mocks base method -func (m *MockNetceptorForWorkceptor) AddWorkCommand(typeName string, verifySignature bool) error { +// DialContext mocks base method. +func (m *MockNetceptorForWorkceptor) DialContext(ctx context.Context, node, service string, tlscfg *tls.Config) (*netceptor.Conn, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AddWorkCommand", typeName, verifySignature) - ret0, _ := ret[0].(error) - return ret0 + ret := m.ctrl.Call(m, "DialContext", ctx, node, service, tlscfg) + ret0, _ := ret[0].(*netceptor.Conn) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// AddWorkCommand indicates an expected call of AddWorkCommand -func (mr *MockNetceptorForWorkceptorMockRecorder) AddWorkCommand(typeName, verifySignature interface{}) *gomock.Call { +// DialContext indicates an expected call of DialContext. +func (mr *MockNetceptorForWorkceptorMockRecorder) DialContext(ctx, node, service, tlscfg any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddWorkCommand", reflect.TypeOf((*MockNetceptorForWorkceptor)(nil).AddWorkCommand), typeName, verifySignature) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DialContext", reflect.TypeOf((*MockNetceptorForWorkceptor)(nil).DialContext), ctx, node, service, tlscfg) } -// GetClientTLSConfig mocks base method +// GetClientTLSConfig mocks base method. func (m *MockNetceptorForWorkceptor) GetClientTLSConfig(name, expectedHostName string, expectedHostNameType netceptor.ExpectedHostnameType) (*tls.Config, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetClientTLSConfig", name, expectedHostName, expectedHostNameType) @@ -73,13 +84,13 @@ func (m *MockNetceptorForWorkceptor) GetClientTLSConfig(name, expectedHostName s return ret0, ret1 } -// GetClientTLSConfig indicates an expected call of GetClientTLSConfig -func (mr *MockNetceptorForWorkceptorMockRecorder) GetClientTLSConfig(name, expectedHostName, expectedHostNameType interface{}) *gomock.Call { +// GetClientTLSConfig indicates an expected call of GetClientTLSConfig. +func (mr *MockNetceptorForWorkceptorMockRecorder) GetClientTLSConfig(name, expectedHostName, expectedHostNameType any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClientTLSConfig", reflect.TypeOf((*MockNetceptorForWorkceptor)(nil).GetClientTLSConfig), name, expectedHostName, expectedHostNameType) } -// GetLogger mocks base method +// GetLogger mocks base method. func (m *MockNetceptorForWorkceptor) GetLogger() *logger.ReceptorLogger { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetLogger") @@ -87,23 +98,146 @@ func (m *MockNetceptorForWorkceptor) GetLogger() *logger.ReceptorLogger { return ret0 } -// GetLogger indicates an expected call of GetLogger +// GetLogger indicates an expected call of GetLogger. func (mr *MockNetceptorForWorkceptorMockRecorder) GetLogger() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogger", reflect.TypeOf((*MockNetceptorForWorkceptor)(nil).GetLogger)) } -// DialContext mocks base method -func (m *MockNetceptorForWorkceptor) DialContext(ctx context.Context, node, service string, tlscfg *tls.Config) (*netceptor.Conn, error) { +// NodeID mocks base method. +func (m *MockNetceptorForWorkceptor) NodeID() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DialContext", ctx, node, service, tlscfg) - ret0, _ := ret[0].(*netceptor.Conn) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret := m.ctrl.Call(m, "NodeID") + ret0, _ := ret[0].(string) + return ret0 } -// DialContext indicates an expected call of DialContext -func (mr *MockNetceptorForWorkceptorMockRecorder) DialContext(ctx, node, service, tlscfg interface{}) *gomock.Call { +// NodeID indicates an expected call of NodeID. +func (mr *MockNetceptorForWorkceptorMockRecorder) NodeID() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DialContext", reflect.TypeOf((*MockNetceptorForWorkceptor)(nil).DialContext), ctx, node, service, tlscfg) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeID", reflect.TypeOf((*MockNetceptorForWorkceptor)(nil).NodeID)) +} + +// MockServerForWorkceptor is a mock of ServerForWorkceptor interface. +type MockServerForWorkceptor struct { + ctrl *gomock.Controller + recorder *MockServerForWorkceptorMockRecorder + isgomock struct{} +} + +// MockServerForWorkceptorMockRecorder is the mock recorder for MockServerForWorkceptor. +type MockServerForWorkceptorMockRecorder struct { + mock *MockServerForWorkceptor +} + +// NewMockServerForWorkceptor creates a new mock instance. +func NewMockServerForWorkceptor(ctrl *gomock.Controller) *MockServerForWorkceptor { + mock := &MockServerForWorkceptor{ctrl: ctrl} + mock.recorder = &MockServerForWorkceptorMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServerForWorkceptor) EXPECT() *MockServerForWorkceptorMockRecorder { + return m.recorder +} + +// AddControlFunc mocks base method. +func (m *MockServerForWorkceptor) AddControlFunc(name string, cType controlsvc.ControlCommandType) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddControlFunc", name, cType) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddControlFunc indicates an expected call of AddControlFunc. +func (mr *MockServerForWorkceptorMockRecorder) AddControlFunc(name, cType any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddControlFunc", reflect.TypeOf((*MockServerForWorkceptor)(nil).AddControlFunc), name, cType) +} + +// ConnectionListener mocks base method. +func (m *MockServerForWorkceptor) ConnectionListener(ctx context.Context, listener net.Listener) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "ConnectionListener", ctx, listener) +} + +// ConnectionListener indicates an expected call of ConnectionListener. +func (mr *MockServerForWorkceptorMockRecorder) ConnectionListener(ctx, listener any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectionListener", reflect.TypeOf((*MockServerForWorkceptor)(nil).ConnectionListener), ctx, listener) +} + +// RunControlSession mocks base method. +func (m *MockServerForWorkceptor) RunControlSession(conn net.Conn) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RunControlSession", conn) +} + +// RunControlSession indicates an expected call of RunControlSession. +func (mr *MockServerForWorkceptorMockRecorder) RunControlSession(conn any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunControlSession", reflect.TypeOf((*MockServerForWorkceptor)(nil).RunControlSession), conn) +} + +// RunControlSvc mocks base method. +func (m *MockServerForWorkceptor) RunControlSvc(ctx context.Context, service string, tlscfg *tls.Config, unixSocket string, unixSocketPermissions fs.FileMode, tcpListen string, tcptls *tls.Config) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RunControlSvc", ctx, service, tlscfg, unixSocket, unixSocketPermissions, tcpListen, tcptls) + ret0, _ := ret[0].(error) + return ret0 +} + +// RunControlSvc indicates an expected call of RunControlSvc. +func (mr *MockServerForWorkceptorMockRecorder) RunControlSvc(ctx, service, tlscfg, unixSocket, unixSocketPermissions, tcpListen, tcptls any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunControlSvc", reflect.TypeOf((*MockServerForWorkceptor)(nil).RunControlSvc), ctx, service, tlscfg, unixSocket, unixSocketPermissions, tcpListen, tcptls) +} + +// SetServerNet mocks base method. +func (m *MockServerForWorkceptor) SetServerNet(n controlsvc.Neter) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetServerNet", n) +} + +// SetServerNet indicates an expected call of SetServerNet. +func (mr *MockServerForWorkceptorMockRecorder) SetServerNet(n any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetServerNet", reflect.TypeOf((*MockServerForWorkceptor)(nil).SetServerNet), n) +} + +// SetServerTLS mocks base method. +func (m *MockServerForWorkceptor) SetServerTLS(t controlsvc.Tlser) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetServerTLS", t) +} + +// SetServerTLS indicates an expected call of SetServerTLS. +func (mr *MockServerForWorkceptorMockRecorder) SetServerTLS(t any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetServerTLS", reflect.TypeOf((*MockServerForWorkceptor)(nil).SetServerTLS), t) +} + +// SetServerUtils mocks base method. +func (m *MockServerForWorkceptor) SetServerUtils(u controlsvc.Utiler) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetServerUtils", u) +} + +// SetServerUtils indicates an expected call of SetServerUtils. +func (mr *MockServerForWorkceptorMockRecorder) SetServerUtils(u any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetServerUtils", reflect.TypeOf((*MockServerForWorkceptor)(nil).SetServerUtils), u) +} + +// SetupConnection mocks base method. +func (m *MockServerForWorkceptor) SetupConnection(conn net.Conn) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetupConnection", conn) +} + +// SetupConnection indicates an expected call of SetupConnection. +func (mr *MockServerForWorkceptorMockRecorder) SetupConnection(conn any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetupConnection", reflect.TypeOf((*MockServerForWorkceptor)(nil).SetupConnection), conn) } diff --git a/pkg/workceptor/mock_workceptor/workunitbase.go b/pkg/workceptor/mock_workceptor/workunitbase.go index 21232d401..5468ee85f 100644 --- a/pkg/workceptor/mock_workceptor/workunitbase.go +++ b/pkg/workceptor/mock_workceptor/workunitbase.go @@ -1,39 +1,46 @@ // Code generated by MockGen. DO NOT EDIT. // Source: pkg/workceptor/workunitbase.go +// +// Generated by this command: +// +// mockgen -source=pkg/workceptor/workunitbase.go -destination=pkg/workceptor/mock_workceptor/workunitbase.go +// // Package mock_workceptor is a generated GoMock package. package mock_workceptor import ( - fsnotify "github.com/fsnotify/fsnotify" - gomock "github.com/golang/mock/gomock" reflect "reflect" + + fsnotify "github.com/fsnotify/fsnotify" + gomock "go.uber.org/mock/gomock" ) -// MockWatcherWrapper is a mock of WatcherWrapper interface +// MockWatcherWrapper is a mock of WatcherWrapper interface. type MockWatcherWrapper struct { ctrl *gomock.Controller recorder *MockWatcherWrapperMockRecorder + isgomock struct{} } -// MockWatcherWrapperMockRecorder is the mock recorder for MockWatcherWrapper +// MockWatcherWrapperMockRecorder is the mock recorder for MockWatcherWrapper. type MockWatcherWrapperMockRecorder struct { mock *MockWatcherWrapper } -// NewMockWatcherWrapper creates a new mock instance +// NewMockWatcherWrapper creates a new mock instance. func NewMockWatcherWrapper(ctrl *gomock.Controller) *MockWatcherWrapper { mock := &MockWatcherWrapper{ctrl: ctrl} mock.recorder = &MockWatcherWrapperMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockWatcherWrapper) EXPECT() *MockWatcherWrapperMockRecorder { return m.recorder } -// Add mocks base method +// Add mocks base method. func (m *MockWatcherWrapper) Add(name string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Add", name) @@ -41,13 +48,13 @@ func (m *MockWatcherWrapper) Add(name string) error { return ret0 } -// Add indicates an expected call of Add -func (mr *MockWatcherWrapperMockRecorder) Add(name interface{}) *gomock.Call { +// Add indicates an expected call of Add. +func (mr *MockWatcherWrapperMockRecorder) Add(name any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockWatcherWrapper)(nil).Add), name) } -// Close mocks base method +// Close mocks base method. func (m *MockWatcherWrapper) Close() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Close") @@ -55,13 +62,13 @@ func (m *MockWatcherWrapper) Close() error { return ret0 } -// Close indicates an expected call of Close +// Close indicates an expected call of Close. func (mr *MockWatcherWrapperMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockWatcherWrapper)(nil).Close)) } -// EventChannel mocks base method +// EventChannel mocks base method. func (m *MockWatcherWrapper) EventChannel() chan fsnotify.Event { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EventChannel") @@ -69,7 +76,7 @@ func (m *MockWatcherWrapper) EventChannel() chan fsnotify.Event { return ret0 } -// EventChannel indicates an expected call of EventChannel +// EventChannel indicates an expected call of EventChannel. func (mr *MockWatcherWrapperMockRecorder) EventChannel() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventChannel", reflect.TypeOf((*MockWatcherWrapper)(nil).EventChannel)) diff --git a/pkg/workceptor/remote_work_test.go b/pkg/workceptor/remote_work_test.go index 1f1e1fa01..de000e786 100644 --- a/pkg/workceptor/remote_work_test.go +++ b/pkg/workceptor/remote_work_test.go @@ -7,7 +7,7 @@ import ( "github.com/ansible/receptor/pkg/workceptor" "github.com/ansible/receptor/pkg/workceptor/mock_workceptor" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) func createRemoteWorkTestSetup(t *testing.T) (workceptor.WorkUnit, *mock_workceptor.MockBaseWorkUnitForWorkUnit, *mock_workceptor.MockNetceptorForWorkceptor, *workceptor.Workceptor) { diff --git a/pkg/workceptor/stdio_utils_test.go b/pkg/workceptor/stdio_utils_test.go index a2e40cbc3..936977504 100644 --- a/pkg/workceptor/stdio_utils_test.go +++ b/pkg/workceptor/stdio_utils_test.go @@ -8,7 +8,7 @@ import ( "github.com/ansible/receptor/pkg/workceptor" "github.com/ansible/receptor/pkg/workceptor/mock_workceptor" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) const errorMsgFmt = "Expected error: %s, got: %v" diff --git a/pkg/workceptor/workceptor_test.go b/pkg/workceptor/workceptor_test.go index 8e81e91de..5dc368adf 100644 --- a/pkg/workceptor/workceptor_test.go +++ b/pkg/workceptor/workceptor_test.go @@ -11,7 +11,7 @@ import ( "github.com/ansible/receptor/pkg/workceptor" "github.com/ansible/receptor/pkg/workceptor/mock_workceptor" "github.com/ansible/receptor/tests/utils" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) func testSetup(t *testing.T) (*gomock.Controller, *mock_workceptor.MockNetceptorForWorkceptor, *workceptor.Workceptor) { diff --git a/pkg/workceptor/workunitbase_test.go b/pkg/workceptor/workunitbase_test.go index 74b976864..19ff3bae9 100644 --- a/pkg/workceptor/workunitbase_test.go +++ b/pkg/workceptor/workunitbase_test.go @@ -13,7 +13,7 @@ import ( "github.com/ansible/receptor/pkg/workceptor" "github.com/ansible/receptor/pkg/workceptor/mock_workceptor" "github.com/fsnotify/fsnotify" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) func TestIsComplete(t *testing.T) {