github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/connector_factory.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mockp2p 4 5 import ( 6 host "github.com/libp2p/go-libp2p/core/host" 7 mock "github.com/stretchr/testify/mock" 8 9 p2p "github.com/onflow/flow-go/network/p2p" 10 ) 11 12 // ConnectorFactory is an autogenerated mock type for the ConnectorFactory type 13 type ConnectorFactory struct { 14 mock.Mock 15 } 16 17 // Execute provides a mock function with given fields: _a0 18 func (_m *ConnectorFactory) Execute(_a0 host.Host) (p2p.Connector, error) { 19 ret := _m.Called(_a0) 20 21 var r0 p2p.Connector 22 var r1 error 23 if rf, ok := ret.Get(0).(func(host.Host) (p2p.Connector, error)); ok { 24 return rf(_a0) 25 } 26 if rf, ok := ret.Get(0).(func(host.Host) p2p.Connector); ok { 27 r0 = rf(_a0) 28 } else { 29 if ret.Get(0) != nil { 30 r0 = ret.Get(0).(p2p.Connector) 31 } 32 } 33 34 if rf, ok := ret.Get(1).(func(host.Host) error); ok { 35 r1 = rf(_a0) 36 } else { 37 r1 = ret.Error(1) 38 } 39 40 return r0, r1 41 } 42 43 type mockConstructorTestingTNewConnectorFactory interface { 44 mock.TestingT 45 Cleanup(func()) 46 } 47 48 // NewConnectorFactory creates a new instance of ConnectorFactory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 49 func NewConnectorFactory(t mockConstructorTestingTNewConnectorFactory) *ConnectorFactory { 50 mock := &ConnectorFactory{} 51 mock.Mock.Test(t) 52 53 t.Cleanup(func() { mock.AssertExpectations(t) }) 54 55 return mock 56 }