github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/engine/access/rpc/connection/mock/connection_factory.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 access "github.com/onflow/flow/protobuf/go/flow/access" 7 8 crypto "github.com/onflow/crypto" 9 10 execution "github.com/onflow/flow/protobuf/go/flow/execution" 11 12 io "io" 13 14 mock "github.com/stretchr/testify/mock" 15 ) 16 17 // ConnectionFactory is an autogenerated mock type for the ConnectionFactory type 18 type ConnectionFactory struct { 19 mock.Mock 20 } 21 22 // GetAccessAPIClient provides a mock function with given fields: address, networkPubKey 23 func (_m *ConnectionFactory) GetAccessAPIClient(address string, networkPubKey crypto.PublicKey) (access.AccessAPIClient, io.Closer, error) { 24 ret := _m.Called(address, networkPubKey) 25 26 var r0 access.AccessAPIClient 27 var r1 io.Closer 28 var r2 error 29 if rf, ok := ret.Get(0).(func(string, crypto.PublicKey) (access.AccessAPIClient, io.Closer, error)); ok { 30 return rf(address, networkPubKey) 31 } 32 if rf, ok := ret.Get(0).(func(string, crypto.PublicKey) access.AccessAPIClient); ok { 33 r0 = rf(address, networkPubKey) 34 } else { 35 if ret.Get(0) != nil { 36 r0 = ret.Get(0).(access.AccessAPIClient) 37 } 38 } 39 40 if rf, ok := ret.Get(1).(func(string, crypto.PublicKey) io.Closer); ok { 41 r1 = rf(address, networkPubKey) 42 } else { 43 if ret.Get(1) != nil { 44 r1 = ret.Get(1).(io.Closer) 45 } 46 } 47 48 if rf, ok := ret.Get(2).(func(string, crypto.PublicKey) error); ok { 49 r2 = rf(address, networkPubKey) 50 } else { 51 r2 = ret.Error(2) 52 } 53 54 return r0, r1, r2 55 } 56 57 // GetAccessAPIClientWithPort provides a mock function with given fields: address, networkPubKey 58 func (_m *ConnectionFactory) GetAccessAPIClientWithPort(address string, networkPubKey crypto.PublicKey) (access.AccessAPIClient, io.Closer, error) { 59 ret := _m.Called(address, networkPubKey) 60 61 var r0 access.AccessAPIClient 62 var r1 io.Closer 63 var r2 error 64 if rf, ok := ret.Get(0).(func(string, crypto.PublicKey) (access.AccessAPIClient, io.Closer, error)); ok { 65 return rf(address, networkPubKey) 66 } 67 if rf, ok := ret.Get(0).(func(string, crypto.PublicKey) access.AccessAPIClient); ok { 68 r0 = rf(address, networkPubKey) 69 } else { 70 if ret.Get(0) != nil { 71 r0 = ret.Get(0).(access.AccessAPIClient) 72 } 73 } 74 75 if rf, ok := ret.Get(1).(func(string, crypto.PublicKey) io.Closer); ok { 76 r1 = rf(address, networkPubKey) 77 } else { 78 if ret.Get(1) != nil { 79 r1 = ret.Get(1).(io.Closer) 80 } 81 } 82 83 if rf, ok := ret.Get(2).(func(string, crypto.PublicKey) error); ok { 84 r2 = rf(address, networkPubKey) 85 } else { 86 r2 = ret.Error(2) 87 } 88 89 return r0, r1, r2 90 } 91 92 // GetExecutionAPIClient provides a mock function with given fields: address 93 func (_m *ConnectionFactory) GetExecutionAPIClient(address string) (execution.ExecutionAPIClient, io.Closer, error) { 94 ret := _m.Called(address) 95 96 var r0 execution.ExecutionAPIClient 97 var r1 io.Closer 98 var r2 error 99 if rf, ok := ret.Get(0).(func(string) (execution.ExecutionAPIClient, io.Closer, error)); ok { 100 return rf(address) 101 } 102 if rf, ok := ret.Get(0).(func(string) execution.ExecutionAPIClient); ok { 103 r0 = rf(address) 104 } else { 105 if ret.Get(0) != nil { 106 r0 = ret.Get(0).(execution.ExecutionAPIClient) 107 } 108 } 109 110 if rf, ok := ret.Get(1).(func(string) io.Closer); ok { 111 r1 = rf(address) 112 } else { 113 if ret.Get(1) != nil { 114 r1 = ret.Get(1).(io.Closer) 115 } 116 } 117 118 if rf, ok := ret.Get(2).(func(string) error); ok { 119 r2 = rf(address) 120 } else { 121 r2 = ret.Error(2) 122 } 123 124 return r0, r1, r2 125 } 126 127 type mockConstructorTestingTNewConnectionFactory interface { 128 mock.TestingT 129 Cleanup(func()) 130 } 131 132 // NewConnectionFactory creates a new instance of ConnectionFactory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 133 func NewConnectionFactory(t mockConstructorTestingTNewConnectionFactory) *ConnectionFactory { 134 mock := &ConnectionFactory{} 135 mock.Mock.Test(t) 136 137 t.Cleanup(func() { mock.AssertExpectations(t) }) 138 139 return mock 140 }