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