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