github.com/koko1123/flow-go-1@v0.29.6/network/p2p/mock/subscription.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 context "context" 7 8 mock "github.com/stretchr/testify/mock" 9 10 pubsub "github.com/libp2p/go-libp2p-pubsub" 11 ) 12 13 // Subscription is an autogenerated mock type for the Subscription type 14 type Subscription struct { 15 mock.Mock 16 } 17 18 // Cancel provides a mock function with given fields: 19 func (_m *Subscription) Cancel() { 20 _m.Called() 21 } 22 23 // Next provides a mock function with given fields: _a0 24 func (_m *Subscription) Next(_a0 context.Context) (*pubsub.Message, error) { 25 ret := _m.Called(_a0) 26 27 var r0 *pubsub.Message 28 if rf, ok := ret.Get(0).(func(context.Context) *pubsub.Message); ok { 29 r0 = rf(_a0) 30 } else { 31 if ret.Get(0) != nil { 32 r0 = ret.Get(0).(*pubsub.Message) 33 } 34 } 35 36 var r1 error 37 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 38 r1 = rf(_a0) 39 } else { 40 r1 = ret.Error(1) 41 } 42 43 return r0, r1 44 } 45 46 // Topic provides a mock function with given fields: 47 func (_m *Subscription) Topic() string { 48 ret := _m.Called() 49 50 var r0 string 51 if rf, ok := ret.Get(0).(func() string); ok { 52 r0 = rf() 53 } else { 54 r0 = ret.Get(0).(string) 55 } 56 57 return r0 58 } 59 60 type mockConstructorTestingTNewSubscription interface { 61 mock.TestingT 62 Cleanup(func()) 63 } 64 65 // NewSubscription creates a new instance of Subscription. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 66 func NewSubscription(t mockConstructorTestingTNewSubscription) *Subscription { 67 mock := &Subscription{} 68 mock.Mock.Test(t) 69 70 t.Cleanup(func() { mock.AssertExpectations(t) }) 71 72 return mock 73 }