github.com/koko1123/flow-go-1@v0.29.6/network/p2p/mock/pub_sub_adapter.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 p2p "github.com/koko1123/flow-go-1/network/p2p" 7 mock "github.com/stretchr/testify/mock" 8 9 peer "github.com/libp2p/go-libp2p/core/peer" 10 ) 11 12 // PubSubAdapter is an autogenerated mock type for the PubSubAdapter type 13 type PubSubAdapter struct { 14 mock.Mock 15 } 16 17 // GetTopics provides a mock function with given fields: 18 func (_m *PubSubAdapter) GetTopics() []string { 19 ret := _m.Called() 20 21 var r0 []string 22 if rf, ok := ret.Get(0).(func() []string); ok { 23 r0 = rf() 24 } else { 25 if ret.Get(0) != nil { 26 r0 = ret.Get(0).([]string) 27 } 28 } 29 30 return r0 31 } 32 33 // Join provides a mock function with given fields: topic 34 func (_m *PubSubAdapter) Join(topic string) (p2p.Topic, error) { 35 ret := _m.Called(topic) 36 37 var r0 p2p.Topic 38 if rf, ok := ret.Get(0).(func(string) p2p.Topic); ok { 39 r0 = rf(topic) 40 } else { 41 if ret.Get(0) != nil { 42 r0 = ret.Get(0).(p2p.Topic) 43 } 44 } 45 46 var r1 error 47 if rf, ok := ret.Get(1).(func(string) error); ok { 48 r1 = rf(topic) 49 } else { 50 r1 = ret.Error(1) 51 } 52 53 return r0, r1 54 } 55 56 // ListPeers provides a mock function with given fields: topic 57 func (_m *PubSubAdapter) ListPeers(topic string) []peer.ID { 58 ret := _m.Called(topic) 59 60 var r0 []peer.ID 61 if rf, ok := ret.Get(0).(func(string) []peer.ID); ok { 62 r0 = rf(topic) 63 } else { 64 if ret.Get(0) != nil { 65 r0 = ret.Get(0).([]peer.ID) 66 } 67 } 68 69 return r0 70 } 71 72 // RegisterTopicValidator provides a mock function with given fields: topic, topicValidator 73 func (_m *PubSubAdapter) RegisterTopicValidator(topic string, topicValidator p2p.TopicValidatorFunc) error { 74 ret := _m.Called(topic, topicValidator) 75 76 var r0 error 77 if rf, ok := ret.Get(0).(func(string, p2p.TopicValidatorFunc) error); ok { 78 r0 = rf(topic, topicValidator) 79 } else { 80 r0 = ret.Error(0) 81 } 82 83 return r0 84 } 85 86 // UnregisterTopicValidator provides a mock function with given fields: topic 87 func (_m *PubSubAdapter) UnregisterTopicValidator(topic string) error { 88 ret := _m.Called(topic) 89 90 var r0 error 91 if rf, ok := ret.Get(0).(func(string) error); ok { 92 r0 = rf(topic) 93 } else { 94 r0 = ret.Error(0) 95 } 96 97 return r0 98 } 99 100 type mockConstructorTestingTNewPubSubAdapter interface { 101 mock.TestingT 102 Cleanup(func()) 103 } 104 105 // NewPubSubAdapter creates a new instance of PubSubAdapter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 106 func NewPubSubAdapter(t mockConstructorTestingTNewPubSubAdapter) *PubSubAdapter { 107 mock := &PubSubAdapter{} 108 mock.Mock.Test(t) 109 110 t.Cleanup(func() { mock.AssertExpectations(t) }) 111 112 return mock 113 }