From 11d67dfabc0e04be4c3bf32565cd614eef8a6f5d Mon Sep 17 00:00:00 2001 From: shydefoo Date: Thu, 16 May 2024 15:22:22 +0800 Subject: [PATCH] Update mock clients --- api/pkg/webhooks/mock_WebhookClient.go | 54 +++++++++++++++++++++++++ api/pkg/webhooks/mock_WebhookManager.go | 46 +++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 api/pkg/webhooks/mock_WebhookManager.go diff --git a/api/pkg/webhooks/mock_WebhookClient.go b/api/pkg/webhooks/mock_WebhookClient.go index 751699ab..2abb1119 100644 --- a/api/pkg/webhooks/mock_WebhookClient.go +++ b/api/pkg/webhooks/mock_WebhookClient.go @@ -31,6 +31,42 @@ func (_m *MockWebhookClient) AbortOnFail() bool { return r0 } +// GetName provides a mock function with given fields: +func (_m *MockWebhookClient) GetName() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetName") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GetUseDataFrom provides a mock function with given fields: +func (_m *MockWebhookClient) GetUseDataFrom() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetUseDataFrom") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + // Invoke provides a mock function with given fields: _a0, _a1 func (_m *MockWebhookClient) Invoke(_a0 context.Context, _a1 []byte) ([]byte, error) { ret := _m.Called(_a0, _a1) @@ -97,6 +133,24 @@ func (_m *MockWebhookClient) IsAsync() bool { return r0 } +// IsFinalResponse provides a mock function with given fields: +func (_m *MockWebhookClient) IsFinalResponse() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsFinalResponse") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + // NewMockWebhookClient creates a new instance of MockWebhookClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockWebhookClient(t interface { diff --git a/api/pkg/webhooks/mock_WebhookManager.go b/api/pkg/webhooks/mock_WebhookManager.go new file mode 100644 index 00000000..9cc21c93 --- /dev/null +++ b/api/pkg/webhooks/mock_WebhookManager.go @@ -0,0 +1,46 @@ +// Code generated by mockery v2.42.1. DO NOT EDIT. + +package webhooks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// MockWebhookManager is an autogenerated mock type for the WebhookManager type +type MockWebhookManager struct { + mock.Mock +} + +// InvokeWebhooks provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 +func (_m *MockWebhookManager) InvokeWebhooks(_a0 context.Context, _a1 EventType, _a2 interface{}, _a3 func([]byte) error, _a4 func(error) error) error { + ret := _m.Called(_a0, _a1, _a2, _a3, _a4) + + if len(ret) == 0 { + panic("no return value specified for InvokeWebhooks") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, EventType, interface{}, func([]byte) error, func(error) error) error); ok { + r0 = rf(_a0, _a1, _a2, _a3, _a4) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// NewMockWebhookManager creates a new instance of MockWebhookManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockWebhookManager(t interface { + mock.TestingT + Cleanup(func()) +}) *MockWebhookManager { + mock := &MockWebhookManager{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}