github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/mocknetwork/subscription_manager.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mocknetwork 4 5 import ( 6 channels "github.com/onflow/flow-go/network/channels" 7 mock "github.com/stretchr/testify/mock" 8 9 network "github.com/onflow/flow-go/network" 10 ) 11 12 // SubscriptionManager is an autogenerated mock type for the SubscriptionManager type 13 type SubscriptionManager struct { 14 mock.Mock 15 } 16 17 // Channels provides a mock function with given fields: 18 func (_m *SubscriptionManager) Channels() channels.ChannelList { 19 ret := _m.Called() 20 21 var r0 channels.ChannelList 22 if rf, ok := ret.Get(0).(func() channels.ChannelList); ok { 23 r0 = rf() 24 } else { 25 if ret.Get(0) != nil { 26 r0 = ret.Get(0).(channels.ChannelList) 27 } 28 } 29 30 return r0 31 } 32 33 // GetEngine provides a mock function with given fields: channel 34 func (_m *SubscriptionManager) GetEngine(channel channels.Channel) (network.MessageProcessor, error) { 35 ret := _m.Called(channel) 36 37 var r0 network.MessageProcessor 38 var r1 error 39 if rf, ok := ret.Get(0).(func(channels.Channel) (network.MessageProcessor, error)); ok { 40 return rf(channel) 41 } 42 if rf, ok := ret.Get(0).(func(channels.Channel) network.MessageProcessor); ok { 43 r0 = rf(channel) 44 } else { 45 if ret.Get(0) != nil { 46 r0 = ret.Get(0).(network.MessageProcessor) 47 } 48 } 49 50 if rf, ok := ret.Get(1).(func(channels.Channel) error); ok { 51 r1 = rf(channel) 52 } else { 53 r1 = ret.Error(1) 54 } 55 56 return r0, r1 57 } 58 59 // Register provides a mock function with given fields: channel, engine 60 func (_m *SubscriptionManager) Register(channel channels.Channel, engine network.MessageProcessor) error { 61 ret := _m.Called(channel, engine) 62 63 var r0 error 64 if rf, ok := ret.Get(0).(func(channels.Channel, network.MessageProcessor) error); ok { 65 r0 = rf(channel, engine) 66 } else { 67 r0 = ret.Error(0) 68 } 69 70 return r0 71 } 72 73 // Unregister provides a mock function with given fields: channel 74 func (_m *SubscriptionManager) Unregister(channel channels.Channel) error { 75 ret := _m.Called(channel) 76 77 var r0 error 78 if rf, ok := ret.Get(0).(func(channels.Channel) error); ok { 79 r0 = rf(channel) 80 } else { 81 r0 = ret.Error(0) 82 } 83 84 return r0 85 } 86 87 type mockConstructorTestingTNewSubscriptionManager interface { 88 mock.TestingT 89 Cleanup(func()) 90 } 91 92 // NewSubscriptionManager creates a new instance of SubscriptionManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 93 func NewSubscriptionManager(t mockConstructorTestingTNewSubscriptionManager) *SubscriptionManager { 94 mock := &SubscriptionManager{} 95 mock.Mock.Test(t) 96 97 t.Cleanup(func() { mock.AssertExpectations(t) }) 98 99 return mock 100 }