mock_event_publisher.go RawHistoryFolder
1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "github.com/bnema/gordon/internal/domain"
9 mock "github.com/stretchr/testify/mock"
10)
11
12// NewMockEventPublisher creates a new instance of MockEventPublisher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
13// The first argument is typically a *testing.T value.
14func NewMockEventPublisher(t interface {
15 mock.TestingT
16 Cleanup(func())
17}) *MockEventPublisher {
18 if helper, ok := t.(interface{ Helper() }); ok {
19 helper.Helper()
20 }
21
22 mock := &MockEventPublisher{}
23 mock.Mock.Test(t)
24
25 t.Cleanup(func() {
26 if helper, ok := t.(interface{ Helper() }); ok {
27 helper.Helper()
28 }
29 mock.AssertExpectations(t)
30 })
31
32 return mock
33}
34
35// MockEventPublisher is an autogenerated mock type for the EventPublisher type
36type MockEventPublisher struct {
37 mock.Mock
38}
39
40type MockEventPublisher_Expecter struct {
41 mock *mock.Mock
42}
43
44func (_m *MockEventPublisher) EXPECT() *MockEventPublisher_Expecter {
45 return &MockEventPublisher_Expecter{mock: &_m.Mock}
46}
47
48// Publish provides a mock function for the type MockEventPublisher
49func (_mock *MockEventPublisher) Publish(eventType domain.EventType, payload any) error {
50 ret := _mock.Called(eventType, payload)
51
52 if len(ret) == 0 {
53 panic("no return value specified for Publish")
54 }
55
56 var r0 error
57 if returnFunc, ok := ret.Get(0).(func(domain.EventType, any) error); ok {
58 r0 = returnFunc(eventType, payload)
59 } else {
60 r0 = ret.Error(0)
61 }
62 return r0
63}
64
65// MockEventPublisher_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish'
66type MockEventPublisher_Publish_Call struct {
67 *mock.Call
68}
69
70// Publish is a helper method to define mock.On call
71// - eventType domain.EventType
72// - payload any
73func (_e *MockEventPublisher_Expecter) Publish(eventType any, payload any) *MockEventPublisher_Publish_Call {
74 return &MockEventPublisher_Publish_Call{Call: _e.mock.On("Publish", eventType, payload)}
75}
76
77func (_c *MockEventPublisher_Publish_Call) Run(run func(eventType domain.EventType, payload any)) *MockEventPublisher_Publish_Call {
78 _c.Call.Run(func(args mock.Arguments) {
79 var arg0 domain.EventType
80 if args[0] != nil {
81 arg0 = args[0].(domain.EventType)
82 }
83 var arg1 any
84 if args[1] != nil {
85 arg1 = args[1].(any)
86 }
87 run(
88 arg0,
89 arg1,
90 )
91 })
92 return _c
93}
94
95func (_c *MockEventPublisher_Publish_Call) Return(err error) *MockEventPublisher_Publish_Call {
96 _c.Call.Return(err)
97 return _c
98}
99
100func (_c *MockEventPublisher_Publish_Call) RunAndReturn(run func(eventType domain.EventType, payload any) error) *MockEventPublisher_Publish_Call {
101 _c.Call.Return(run)
102 return _c
103}