mocked_connection_info_test.go 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. // Code generated by counterfeiter. DO NOT EDIT.
  2. package protocol
  3. import (
  4. "net"
  5. "sync"
  6. "time"
  7. )
  8. type mockedConnectionInfo struct {
  9. ConnectionIDStub func() string
  10. connectionIDMutex sync.RWMutex
  11. connectionIDArgsForCall []struct {
  12. }
  13. connectionIDReturns struct {
  14. result1 string
  15. }
  16. connectionIDReturnsOnCall map[int]struct {
  17. result1 string
  18. }
  19. CryptoStub func() string
  20. cryptoMutex sync.RWMutex
  21. cryptoArgsForCall []struct {
  22. }
  23. cryptoReturns struct {
  24. result1 string
  25. }
  26. cryptoReturnsOnCall map[int]struct {
  27. result1 string
  28. }
  29. EstablishedAtStub func() time.Time
  30. establishedAtMutex sync.RWMutex
  31. establishedAtArgsForCall []struct {
  32. }
  33. establishedAtReturns struct {
  34. result1 time.Time
  35. }
  36. establishedAtReturnsOnCall map[int]struct {
  37. result1 time.Time
  38. }
  39. IsLocalStub func() bool
  40. isLocalMutex sync.RWMutex
  41. isLocalArgsForCall []struct {
  42. }
  43. isLocalReturns struct {
  44. result1 bool
  45. }
  46. isLocalReturnsOnCall map[int]struct {
  47. result1 bool
  48. }
  49. PriorityStub func() int
  50. priorityMutex sync.RWMutex
  51. priorityArgsForCall []struct {
  52. }
  53. priorityReturns struct {
  54. result1 int
  55. }
  56. priorityReturnsOnCall map[int]struct {
  57. result1 int
  58. }
  59. RemoteAddrStub func() net.Addr
  60. remoteAddrMutex sync.RWMutex
  61. remoteAddrArgsForCall []struct {
  62. }
  63. remoteAddrReturns struct {
  64. result1 net.Addr
  65. }
  66. remoteAddrReturnsOnCall map[int]struct {
  67. result1 net.Addr
  68. }
  69. StringStub func() string
  70. stringMutex sync.RWMutex
  71. stringArgsForCall []struct {
  72. }
  73. stringReturns struct {
  74. result1 string
  75. }
  76. stringReturnsOnCall map[int]struct {
  77. result1 string
  78. }
  79. TransportStub func() string
  80. transportMutex sync.RWMutex
  81. transportArgsForCall []struct {
  82. }
  83. transportReturns struct {
  84. result1 string
  85. }
  86. transportReturnsOnCall map[int]struct {
  87. result1 string
  88. }
  89. TypeStub func() string
  90. typeMutex sync.RWMutex
  91. typeArgsForCall []struct {
  92. }
  93. typeReturns struct {
  94. result1 string
  95. }
  96. typeReturnsOnCall map[int]struct {
  97. result1 string
  98. }
  99. invocations map[string][][]interface{}
  100. invocationsMutex sync.RWMutex
  101. }
  102. func (fake *mockedConnectionInfo) ConnectionID() string {
  103. fake.connectionIDMutex.Lock()
  104. ret, specificReturn := fake.connectionIDReturnsOnCall[len(fake.connectionIDArgsForCall)]
  105. fake.connectionIDArgsForCall = append(fake.connectionIDArgsForCall, struct {
  106. }{})
  107. stub := fake.ConnectionIDStub
  108. fakeReturns := fake.connectionIDReturns
  109. fake.recordInvocation("ConnectionID", []interface{}{})
  110. fake.connectionIDMutex.Unlock()
  111. if stub != nil {
  112. return stub()
  113. }
  114. if specificReturn {
  115. return ret.result1
  116. }
  117. return fakeReturns.result1
  118. }
  119. func (fake *mockedConnectionInfo) ConnectionIDCallCount() int {
  120. fake.connectionIDMutex.RLock()
  121. defer fake.connectionIDMutex.RUnlock()
  122. return len(fake.connectionIDArgsForCall)
  123. }
  124. func (fake *mockedConnectionInfo) ConnectionIDCalls(stub func() string) {
  125. fake.connectionIDMutex.Lock()
  126. defer fake.connectionIDMutex.Unlock()
  127. fake.ConnectionIDStub = stub
  128. }
  129. func (fake *mockedConnectionInfo) ConnectionIDReturns(result1 string) {
  130. fake.connectionIDMutex.Lock()
  131. defer fake.connectionIDMutex.Unlock()
  132. fake.ConnectionIDStub = nil
  133. fake.connectionIDReturns = struct {
  134. result1 string
  135. }{result1}
  136. }
  137. func (fake *mockedConnectionInfo) ConnectionIDReturnsOnCall(i int, result1 string) {
  138. fake.connectionIDMutex.Lock()
  139. defer fake.connectionIDMutex.Unlock()
  140. fake.ConnectionIDStub = nil
  141. if fake.connectionIDReturnsOnCall == nil {
  142. fake.connectionIDReturnsOnCall = make(map[int]struct {
  143. result1 string
  144. })
  145. }
  146. fake.connectionIDReturnsOnCall[i] = struct {
  147. result1 string
  148. }{result1}
  149. }
  150. func (fake *mockedConnectionInfo) Crypto() string {
  151. fake.cryptoMutex.Lock()
  152. ret, specificReturn := fake.cryptoReturnsOnCall[len(fake.cryptoArgsForCall)]
  153. fake.cryptoArgsForCall = append(fake.cryptoArgsForCall, struct {
  154. }{})
  155. stub := fake.CryptoStub
  156. fakeReturns := fake.cryptoReturns
  157. fake.recordInvocation("Crypto", []interface{}{})
  158. fake.cryptoMutex.Unlock()
  159. if stub != nil {
  160. return stub()
  161. }
  162. if specificReturn {
  163. return ret.result1
  164. }
  165. return fakeReturns.result1
  166. }
  167. func (fake *mockedConnectionInfo) CryptoCallCount() int {
  168. fake.cryptoMutex.RLock()
  169. defer fake.cryptoMutex.RUnlock()
  170. return len(fake.cryptoArgsForCall)
  171. }
  172. func (fake *mockedConnectionInfo) CryptoCalls(stub func() string) {
  173. fake.cryptoMutex.Lock()
  174. defer fake.cryptoMutex.Unlock()
  175. fake.CryptoStub = stub
  176. }
  177. func (fake *mockedConnectionInfo) CryptoReturns(result1 string) {
  178. fake.cryptoMutex.Lock()
  179. defer fake.cryptoMutex.Unlock()
  180. fake.CryptoStub = nil
  181. fake.cryptoReturns = struct {
  182. result1 string
  183. }{result1}
  184. }
  185. func (fake *mockedConnectionInfo) CryptoReturnsOnCall(i int, result1 string) {
  186. fake.cryptoMutex.Lock()
  187. defer fake.cryptoMutex.Unlock()
  188. fake.CryptoStub = nil
  189. if fake.cryptoReturnsOnCall == nil {
  190. fake.cryptoReturnsOnCall = make(map[int]struct {
  191. result1 string
  192. })
  193. }
  194. fake.cryptoReturnsOnCall[i] = struct {
  195. result1 string
  196. }{result1}
  197. }
  198. func (fake *mockedConnectionInfo) EstablishedAt() time.Time {
  199. fake.establishedAtMutex.Lock()
  200. ret, specificReturn := fake.establishedAtReturnsOnCall[len(fake.establishedAtArgsForCall)]
  201. fake.establishedAtArgsForCall = append(fake.establishedAtArgsForCall, struct {
  202. }{})
  203. stub := fake.EstablishedAtStub
  204. fakeReturns := fake.establishedAtReturns
  205. fake.recordInvocation("EstablishedAt", []interface{}{})
  206. fake.establishedAtMutex.Unlock()
  207. if stub != nil {
  208. return stub()
  209. }
  210. if specificReturn {
  211. return ret.result1
  212. }
  213. return fakeReturns.result1
  214. }
  215. func (fake *mockedConnectionInfo) EstablishedAtCallCount() int {
  216. fake.establishedAtMutex.RLock()
  217. defer fake.establishedAtMutex.RUnlock()
  218. return len(fake.establishedAtArgsForCall)
  219. }
  220. func (fake *mockedConnectionInfo) EstablishedAtCalls(stub func() time.Time) {
  221. fake.establishedAtMutex.Lock()
  222. defer fake.establishedAtMutex.Unlock()
  223. fake.EstablishedAtStub = stub
  224. }
  225. func (fake *mockedConnectionInfo) EstablishedAtReturns(result1 time.Time) {
  226. fake.establishedAtMutex.Lock()
  227. defer fake.establishedAtMutex.Unlock()
  228. fake.EstablishedAtStub = nil
  229. fake.establishedAtReturns = struct {
  230. result1 time.Time
  231. }{result1}
  232. }
  233. func (fake *mockedConnectionInfo) EstablishedAtReturnsOnCall(i int, result1 time.Time) {
  234. fake.establishedAtMutex.Lock()
  235. defer fake.establishedAtMutex.Unlock()
  236. fake.EstablishedAtStub = nil
  237. if fake.establishedAtReturnsOnCall == nil {
  238. fake.establishedAtReturnsOnCall = make(map[int]struct {
  239. result1 time.Time
  240. })
  241. }
  242. fake.establishedAtReturnsOnCall[i] = struct {
  243. result1 time.Time
  244. }{result1}
  245. }
  246. func (fake *mockedConnectionInfo) IsLocal() bool {
  247. fake.isLocalMutex.Lock()
  248. ret, specificReturn := fake.isLocalReturnsOnCall[len(fake.isLocalArgsForCall)]
  249. fake.isLocalArgsForCall = append(fake.isLocalArgsForCall, struct {
  250. }{})
  251. stub := fake.IsLocalStub
  252. fakeReturns := fake.isLocalReturns
  253. fake.recordInvocation("IsLocal", []interface{}{})
  254. fake.isLocalMutex.Unlock()
  255. if stub != nil {
  256. return stub()
  257. }
  258. if specificReturn {
  259. return ret.result1
  260. }
  261. return fakeReturns.result1
  262. }
  263. func (fake *mockedConnectionInfo) IsLocalCallCount() int {
  264. fake.isLocalMutex.RLock()
  265. defer fake.isLocalMutex.RUnlock()
  266. return len(fake.isLocalArgsForCall)
  267. }
  268. func (fake *mockedConnectionInfo) IsLocalCalls(stub func() bool) {
  269. fake.isLocalMutex.Lock()
  270. defer fake.isLocalMutex.Unlock()
  271. fake.IsLocalStub = stub
  272. }
  273. func (fake *mockedConnectionInfo) IsLocalReturns(result1 bool) {
  274. fake.isLocalMutex.Lock()
  275. defer fake.isLocalMutex.Unlock()
  276. fake.IsLocalStub = nil
  277. fake.isLocalReturns = struct {
  278. result1 bool
  279. }{result1}
  280. }
  281. func (fake *mockedConnectionInfo) IsLocalReturnsOnCall(i int, result1 bool) {
  282. fake.isLocalMutex.Lock()
  283. defer fake.isLocalMutex.Unlock()
  284. fake.IsLocalStub = nil
  285. if fake.isLocalReturnsOnCall == nil {
  286. fake.isLocalReturnsOnCall = make(map[int]struct {
  287. result1 bool
  288. })
  289. }
  290. fake.isLocalReturnsOnCall[i] = struct {
  291. result1 bool
  292. }{result1}
  293. }
  294. func (fake *mockedConnectionInfo) Priority() int {
  295. fake.priorityMutex.Lock()
  296. ret, specificReturn := fake.priorityReturnsOnCall[len(fake.priorityArgsForCall)]
  297. fake.priorityArgsForCall = append(fake.priorityArgsForCall, struct {
  298. }{})
  299. stub := fake.PriorityStub
  300. fakeReturns := fake.priorityReturns
  301. fake.recordInvocation("Priority", []interface{}{})
  302. fake.priorityMutex.Unlock()
  303. if stub != nil {
  304. return stub()
  305. }
  306. if specificReturn {
  307. return ret.result1
  308. }
  309. return fakeReturns.result1
  310. }
  311. func (fake *mockedConnectionInfo) PriorityCallCount() int {
  312. fake.priorityMutex.RLock()
  313. defer fake.priorityMutex.RUnlock()
  314. return len(fake.priorityArgsForCall)
  315. }
  316. func (fake *mockedConnectionInfo) PriorityCalls(stub func() int) {
  317. fake.priorityMutex.Lock()
  318. defer fake.priorityMutex.Unlock()
  319. fake.PriorityStub = stub
  320. }
  321. func (fake *mockedConnectionInfo) PriorityReturns(result1 int) {
  322. fake.priorityMutex.Lock()
  323. defer fake.priorityMutex.Unlock()
  324. fake.PriorityStub = nil
  325. fake.priorityReturns = struct {
  326. result1 int
  327. }{result1}
  328. }
  329. func (fake *mockedConnectionInfo) PriorityReturnsOnCall(i int, result1 int) {
  330. fake.priorityMutex.Lock()
  331. defer fake.priorityMutex.Unlock()
  332. fake.PriorityStub = nil
  333. if fake.priorityReturnsOnCall == nil {
  334. fake.priorityReturnsOnCall = make(map[int]struct {
  335. result1 int
  336. })
  337. }
  338. fake.priorityReturnsOnCall[i] = struct {
  339. result1 int
  340. }{result1}
  341. }
  342. func (fake *mockedConnectionInfo) RemoteAddr() net.Addr {
  343. fake.remoteAddrMutex.Lock()
  344. ret, specificReturn := fake.remoteAddrReturnsOnCall[len(fake.remoteAddrArgsForCall)]
  345. fake.remoteAddrArgsForCall = append(fake.remoteAddrArgsForCall, struct {
  346. }{})
  347. stub := fake.RemoteAddrStub
  348. fakeReturns := fake.remoteAddrReturns
  349. fake.recordInvocation("RemoteAddr", []interface{}{})
  350. fake.remoteAddrMutex.Unlock()
  351. if stub != nil {
  352. return stub()
  353. }
  354. if specificReturn {
  355. return ret.result1
  356. }
  357. return fakeReturns.result1
  358. }
  359. func (fake *mockedConnectionInfo) RemoteAddrCallCount() int {
  360. fake.remoteAddrMutex.RLock()
  361. defer fake.remoteAddrMutex.RUnlock()
  362. return len(fake.remoteAddrArgsForCall)
  363. }
  364. func (fake *mockedConnectionInfo) RemoteAddrCalls(stub func() net.Addr) {
  365. fake.remoteAddrMutex.Lock()
  366. defer fake.remoteAddrMutex.Unlock()
  367. fake.RemoteAddrStub = stub
  368. }
  369. func (fake *mockedConnectionInfo) RemoteAddrReturns(result1 net.Addr) {
  370. fake.remoteAddrMutex.Lock()
  371. defer fake.remoteAddrMutex.Unlock()
  372. fake.RemoteAddrStub = nil
  373. fake.remoteAddrReturns = struct {
  374. result1 net.Addr
  375. }{result1}
  376. }
  377. func (fake *mockedConnectionInfo) RemoteAddrReturnsOnCall(i int, result1 net.Addr) {
  378. fake.remoteAddrMutex.Lock()
  379. defer fake.remoteAddrMutex.Unlock()
  380. fake.RemoteAddrStub = nil
  381. if fake.remoteAddrReturnsOnCall == nil {
  382. fake.remoteAddrReturnsOnCall = make(map[int]struct {
  383. result1 net.Addr
  384. })
  385. }
  386. fake.remoteAddrReturnsOnCall[i] = struct {
  387. result1 net.Addr
  388. }{result1}
  389. }
  390. func (fake *mockedConnectionInfo) String() string {
  391. fake.stringMutex.Lock()
  392. ret, specificReturn := fake.stringReturnsOnCall[len(fake.stringArgsForCall)]
  393. fake.stringArgsForCall = append(fake.stringArgsForCall, struct {
  394. }{})
  395. stub := fake.StringStub
  396. fakeReturns := fake.stringReturns
  397. fake.recordInvocation("String", []interface{}{})
  398. fake.stringMutex.Unlock()
  399. if stub != nil {
  400. return stub()
  401. }
  402. if specificReturn {
  403. return ret.result1
  404. }
  405. return fakeReturns.result1
  406. }
  407. func (fake *mockedConnectionInfo) StringCallCount() int {
  408. fake.stringMutex.RLock()
  409. defer fake.stringMutex.RUnlock()
  410. return len(fake.stringArgsForCall)
  411. }
  412. func (fake *mockedConnectionInfo) StringCalls(stub func() string) {
  413. fake.stringMutex.Lock()
  414. defer fake.stringMutex.Unlock()
  415. fake.StringStub = stub
  416. }
  417. func (fake *mockedConnectionInfo) StringReturns(result1 string) {
  418. fake.stringMutex.Lock()
  419. defer fake.stringMutex.Unlock()
  420. fake.StringStub = nil
  421. fake.stringReturns = struct {
  422. result1 string
  423. }{result1}
  424. }
  425. func (fake *mockedConnectionInfo) StringReturnsOnCall(i int, result1 string) {
  426. fake.stringMutex.Lock()
  427. defer fake.stringMutex.Unlock()
  428. fake.StringStub = nil
  429. if fake.stringReturnsOnCall == nil {
  430. fake.stringReturnsOnCall = make(map[int]struct {
  431. result1 string
  432. })
  433. }
  434. fake.stringReturnsOnCall[i] = struct {
  435. result1 string
  436. }{result1}
  437. }
  438. func (fake *mockedConnectionInfo) Transport() string {
  439. fake.transportMutex.Lock()
  440. ret, specificReturn := fake.transportReturnsOnCall[len(fake.transportArgsForCall)]
  441. fake.transportArgsForCall = append(fake.transportArgsForCall, struct {
  442. }{})
  443. stub := fake.TransportStub
  444. fakeReturns := fake.transportReturns
  445. fake.recordInvocation("Transport", []interface{}{})
  446. fake.transportMutex.Unlock()
  447. if stub != nil {
  448. return stub()
  449. }
  450. if specificReturn {
  451. return ret.result1
  452. }
  453. return fakeReturns.result1
  454. }
  455. func (fake *mockedConnectionInfo) TransportCallCount() int {
  456. fake.transportMutex.RLock()
  457. defer fake.transportMutex.RUnlock()
  458. return len(fake.transportArgsForCall)
  459. }
  460. func (fake *mockedConnectionInfo) TransportCalls(stub func() string) {
  461. fake.transportMutex.Lock()
  462. defer fake.transportMutex.Unlock()
  463. fake.TransportStub = stub
  464. }
  465. func (fake *mockedConnectionInfo) TransportReturns(result1 string) {
  466. fake.transportMutex.Lock()
  467. defer fake.transportMutex.Unlock()
  468. fake.TransportStub = nil
  469. fake.transportReturns = struct {
  470. result1 string
  471. }{result1}
  472. }
  473. func (fake *mockedConnectionInfo) TransportReturnsOnCall(i int, result1 string) {
  474. fake.transportMutex.Lock()
  475. defer fake.transportMutex.Unlock()
  476. fake.TransportStub = nil
  477. if fake.transportReturnsOnCall == nil {
  478. fake.transportReturnsOnCall = make(map[int]struct {
  479. result1 string
  480. })
  481. }
  482. fake.transportReturnsOnCall[i] = struct {
  483. result1 string
  484. }{result1}
  485. }
  486. func (fake *mockedConnectionInfo) Type() string {
  487. fake.typeMutex.Lock()
  488. ret, specificReturn := fake.typeReturnsOnCall[len(fake.typeArgsForCall)]
  489. fake.typeArgsForCall = append(fake.typeArgsForCall, struct {
  490. }{})
  491. stub := fake.TypeStub
  492. fakeReturns := fake.typeReturns
  493. fake.recordInvocation("Type", []interface{}{})
  494. fake.typeMutex.Unlock()
  495. if stub != nil {
  496. return stub()
  497. }
  498. if specificReturn {
  499. return ret.result1
  500. }
  501. return fakeReturns.result1
  502. }
  503. func (fake *mockedConnectionInfo) TypeCallCount() int {
  504. fake.typeMutex.RLock()
  505. defer fake.typeMutex.RUnlock()
  506. return len(fake.typeArgsForCall)
  507. }
  508. func (fake *mockedConnectionInfo) TypeCalls(stub func() string) {
  509. fake.typeMutex.Lock()
  510. defer fake.typeMutex.Unlock()
  511. fake.TypeStub = stub
  512. }
  513. func (fake *mockedConnectionInfo) TypeReturns(result1 string) {
  514. fake.typeMutex.Lock()
  515. defer fake.typeMutex.Unlock()
  516. fake.TypeStub = nil
  517. fake.typeReturns = struct {
  518. result1 string
  519. }{result1}
  520. }
  521. func (fake *mockedConnectionInfo) TypeReturnsOnCall(i int, result1 string) {
  522. fake.typeMutex.Lock()
  523. defer fake.typeMutex.Unlock()
  524. fake.TypeStub = nil
  525. if fake.typeReturnsOnCall == nil {
  526. fake.typeReturnsOnCall = make(map[int]struct {
  527. result1 string
  528. })
  529. }
  530. fake.typeReturnsOnCall[i] = struct {
  531. result1 string
  532. }{result1}
  533. }
  534. func (fake *mockedConnectionInfo) Invocations() map[string][][]interface{} {
  535. fake.invocationsMutex.RLock()
  536. defer fake.invocationsMutex.RUnlock()
  537. copiedInvocations := map[string][][]interface{}{}
  538. for key, value := range fake.invocations {
  539. copiedInvocations[key] = value
  540. }
  541. return copiedInvocations
  542. }
  543. func (fake *mockedConnectionInfo) recordInvocation(key string, args []interface{}) {
  544. fake.invocationsMutex.Lock()
  545. defer fake.invocationsMutex.Unlock()
  546. if fake.invocations == nil {
  547. fake.invocations = map[string][][]interface{}{}
  548. }
  549. if fake.invocations[key] == nil {
  550. fake.invocations[key] = [][]interface{}{}
  551. }
  552. fake.invocations[key] = append(fake.invocations[key], args)
  553. }