github.com/koko1123/flow-go-1@v0.29.6/network/p2p/mock/topic_provider.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 mock "github.com/stretchr/testify/mock" 7 8 peer "github.com/libp2p/go-libp2p/core/peer" 9 ) 10 11 // TopicProvider is an autogenerated mock type for the TopicProvider type 12 type TopicProvider struct { 13 mock.Mock 14 } 15 16 // GetTopics provides a mock function with given fields: 17 func (_m *TopicProvider) GetTopics() []string { 18 ret := _m.Called() 19 20 var r0 []string 21 if rf, ok := ret.Get(0).(func() []string); ok { 22 r0 = rf() 23 } else { 24 if ret.Get(0) != nil { 25 r0 = ret.Get(0).([]string) 26 } 27 } 28 29 return r0 30 } 31 32 // ListPeers provides a mock function with given fields: topic 33 func (_m *TopicProvider) ListPeers(topic string) []peer.ID { 34 ret := _m.Called(topic) 35 36 var r0 []peer.ID 37 if rf, ok := ret.Get(0).(func(string) []peer.ID); ok { 38 r0 = rf(topic) 39 } else { 40 if ret.Get(0) != nil { 41 r0 = ret.Get(0).([]peer.ID) 42 } 43 } 44 45 return r0 46 } 47 48 type mockConstructorTestingTNewTopicProvider interface { 49 mock.TestingT 50 Cleanup(func()) 51 } 52 53 // NewTopicProvider creates a new instance of TopicProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 54 func NewTopicProvider(t mockConstructorTestingTNewTopicProvider) *TopicProvider { 55 mock := &TopicProvider{} 56 mock.Mock.Test(t) 57 58 t.Cleanup(func() { mock.AssertExpectations(t) }) 59 60 return mock 61 }