github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/mocknetwork/ping_service.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mocknetwork 4 5 import ( 6 context "context" 7 8 message "github.com/onflow/flow-go/network/message" 9 mock "github.com/stretchr/testify/mock" 10 11 peer "github.com/libp2p/go-libp2p/core/peer" 12 13 time "time" 14 ) 15 16 // PingService is an autogenerated mock type for the PingService type 17 type PingService struct { 18 mock.Mock 19 } 20 21 // Ping provides a mock function with given fields: ctx, peerID 22 func (_m *PingService) Ping(ctx context.Context, peerID peer.ID) (message.PingResponse, time.Duration, error) { 23 ret := _m.Called(ctx, peerID) 24 25 var r0 message.PingResponse 26 var r1 time.Duration 27 var r2 error 28 if rf, ok := ret.Get(0).(func(context.Context, peer.ID) (message.PingResponse, time.Duration, error)); ok { 29 return rf(ctx, peerID) 30 } 31 if rf, ok := ret.Get(0).(func(context.Context, peer.ID) message.PingResponse); ok { 32 r0 = rf(ctx, peerID) 33 } else { 34 r0 = ret.Get(0).(message.PingResponse) 35 } 36 37 if rf, ok := ret.Get(1).(func(context.Context, peer.ID) time.Duration); ok { 38 r1 = rf(ctx, peerID) 39 } else { 40 r1 = ret.Get(1).(time.Duration) 41 } 42 43 if rf, ok := ret.Get(2).(func(context.Context, peer.ID) error); ok { 44 r2 = rf(ctx, peerID) 45 } else { 46 r2 = ret.Error(2) 47 } 48 49 return r0, r1, r2 50 } 51 52 type mockConstructorTestingTNewPingService interface { 53 mock.TestingT 54 Cleanup(func()) 55 } 56 57 // NewPingService creates a new instance of PingService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 58 func NewPingService(t mockConstructorTestingTNewPingService) *PingService { 59 mock := &PingService{} 60 mock.Mock.Test(t) 61 62 t.Cleanup(func() { mock.AssertExpectations(t) }) 63 64 return mock 65 }