github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/gossip_sub_factory_func.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 host "github.com/libp2p/go-libp2p/core/host" 9 mock "github.com/stretchr/testify/mock" 10 11 p2p "github.com/onflow/flow-go/network/p2p" 12 13 zerolog "github.com/rs/zerolog" 14 ) 15 16 // GossipSubFactoryFunc is an autogenerated mock type for the GossipSubFactoryFunc type 17 type GossipSubFactoryFunc struct { 18 mock.Mock 19 } 20 21 // Execute provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 22 func (_m *GossipSubFactoryFunc) Execute(_a0 context.Context, _a1 zerolog.Logger, _a2 host.Host, _a3 p2p.PubSubAdapterConfig, _a4 p2p.CollectionClusterChangesConsumer) (p2p.PubSubAdapter, error) { 23 ret := _m.Called(_a0, _a1, _a2, _a3, _a4) 24 25 var r0 p2p.PubSubAdapter 26 var r1 error 27 if rf, ok := ret.Get(0).(func(context.Context, zerolog.Logger, host.Host, p2p.PubSubAdapterConfig, p2p.CollectionClusterChangesConsumer) (p2p.PubSubAdapter, error)); ok { 28 return rf(_a0, _a1, _a2, _a3, _a4) 29 } 30 if rf, ok := ret.Get(0).(func(context.Context, zerolog.Logger, host.Host, p2p.PubSubAdapterConfig, p2p.CollectionClusterChangesConsumer) p2p.PubSubAdapter); ok { 31 r0 = rf(_a0, _a1, _a2, _a3, _a4) 32 } else { 33 if ret.Get(0) != nil { 34 r0 = ret.Get(0).(p2p.PubSubAdapter) 35 } 36 } 37 38 if rf, ok := ret.Get(1).(func(context.Context, zerolog.Logger, host.Host, p2p.PubSubAdapterConfig, p2p.CollectionClusterChangesConsumer) error); ok { 39 r1 = rf(_a0, _a1, _a2, _a3, _a4) 40 } else { 41 r1 = ret.Error(1) 42 } 43 44 return r0, r1 45 } 46 47 type mockConstructorTestingTNewGossipSubFactoryFunc interface { 48 mock.TestingT 49 Cleanup(func()) 50 } 51 52 // NewGossipSubFactoryFunc creates a new instance of GossipSubFactoryFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 53 func NewGossipSubFactoryFunc(t mockConstructorTestingTNewGossipSubFactoryFunc) *GossipSubFactoryFunc { 54 mock := &GossipSubFactoryFunc{} 55 mock.Mock.Test(t) 56 57 t.Cleanup(func() { mock.AssertExpectations(t) }) 58 59 return mock 60 }