mocks_test.go 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564
  1. // Code generated by go-mockgen 1.3.7; DO NOT EDIT.
  2. //
  3. // This file was generated by running `go-mockgen` at the root of this repository.
  4. // To add additional mocks to this or another package, add a new entry to the
  5. // mockgen.yaml file in the root of this repository.
  6. package lfs
  7. import (
  8. "context"
  9. "sync"
  10. database "gogs.io/gogs/internal/database"
  11. lfsutil "gogs.io/gogs/internal/lfsutil"
  12. )
  13. // MockStore is a mock implementation of the Store interface (from the
  14. // package gogs.io/gogs/internal/route/lfs) used for unit testing.
  15. type MockStore struct {
  16. // AuthenticateUserFunc is an instance of a mock function object
  17. // controlling the behavior of the method AuthenticateUser.
  18. AuthenticateUserFunc *StoreAuthenticateUserFunc
  19. // AuthorizeRepositoryAccessFunc is an instance of a mock function
  20. // object controlling the behavior of the method
  21. // AuthorizeRepositoryAccess.
  22. AuthorizeRepositoryAccessFunc *StoreAuthorizeRepositoryAccessFunc
  23. // CreateLFSObjectFunc is an instance of a mock function object
  24. // controlling the behavior of the method CreateLFSObject.
  25. CreateLFSObjectFunc *StoreCreateLFSObjectFunc
  26. // CreateUserFunc is an instance of a mock function object controlling
  27. // the behavior of the method CreateUser.
  28. CreateUserFunc *StoreCreateUserFunc
  29. // GetAccessTokenBySHA1Func is an instance of a mock function object
  30. // controlling the behavior of the method GetAccessTokenBySHA1.
  31. GetAccessTokenBySHA1Func *StoreGetAccessTokenBySHA1Func
  32. // GetLFSObjectByOIDFunc is an instance of a mock function object
  33. // controlling the behavior of the method GetLFSObjectByOID.
  34. GetLFSObjectByOIDFunc *StoreGetLFSObjectByOIDFunc
  35. // GetLFSObjectsByOIDsFunc is an instance of a mock function object
  36. // controlling the behavior of the method GetLFSObjectsByOIDs.
  37. GetLFSObjectsByOIDsFunc *StoreGetLFSObjectsByOIDsFunc
  38. // GetRepositoryByNameFunc is an instance of a mock function object
  39. // controlling the behavior of the method GetRepositoryByName.
  40. GetRepositoryByNameFunc *StoreGetRepositoryByNameFunc
  41. // GetUserByIDFunc is an instance of a mock function object controlling
  42. // the behavior of the method GetUserByID.
  43. GetUserByIDFunc *StoreGetUserByIDFunc
  44. // GetUserByUsernameFunc is an instance of a mock function object
  45. // controlling the behavior of the method GetUserByUsername.
  46. GetUserByUsernameFunc *StoreGetUserByUsernameFunc
  47. // IsTwoFactorEnabledFunc is an instance of a mock function object
  48. // controlling the behavior of the method IsTwoFactorEnabled.
  49. IsTwoFactorEnabledFunc *StoreIsTwoFactorEnabledFunc
  50. // TouchAccessTokenByIDFunc is an instance of a mock function object
  51. // controlling the behavior of the method TouchAccessTokenByID.
  52. TouchAccessTokenByIDFunc *StoreTouchAccessTokenByIDFunc
  53. }
  54. // NewMockStore creates a new mock of the Store interface. All methods
  55. // return zero values for all results, unless overwritten.
  56. func NewMockStore() *MockStore {
  57. return &MockStore{
  58. AuthenticateUserFunc: &StoreAuthenticateUserFunc{
  59. defaultHook: func(context.Context, string, string, int64) (r0 *database.User, r1 error) {
  60. return
  61. },
  62. },
  63. AuthorizeRepositoryAccessFunc: &StoreAuthorizeRepositoryAccessFunc{
  64. defaultHook: func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) (r0 bool) {
  65. return
  66. },
  67. },
  68. CreateLFSObjectFunc: &StoreCreateLFSObjectFunc{
  69. defaultHook: func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) (r0 error) {
  70. return
  71. },
  72. },
  73. CreateUserFunc: &StoreCreateUserFunc{
  74. defaultHook: func(context.Context, string, string, database.CreateUserOptions) (r0 *database.User, r1 error) {
  75. return
  76. },
  77. },
  78. GetAccessTokenBySHA1Func: &StoreGetAccessTokenBySHA1Func{
  79. defaultHook: func(context.Context, string) (r0 *database.AccessToken, r1 error) {
  80. return
  81. },
  82. },
  83. GetLFSObjectByOIDFunc: &StoreGetLFSObjectByOIDFunc{
  84. defaultHook: func(context.Context, int64, lfsutil.OID) (r0 *database.LFSObject, r1 error) {
  85. return
  86. },
  87. },
  88. GetLFSObjectsByOIDsFunc: &StoreGetLFSObjectsByOIDsFunc{
  89. defaultHook: func(context.Context, int64, ...lfsutil.OID) (r0 []*database.LFSObject, r1 error) {
  90. return
  91. },
  92. },
  93. GetRepositoryByNameFunc: &StoreGetRepositoryByNameFunc{
  94. defaultHook: func(context.Context, int64, string) (r0 *database.Repository, r1 error) {
  95. return
  96. },
  97. },
  98. GetUserByIDFunc: &StoreGetUserByIDFunc{
  99. defaultHook: func(context.Context, int64) (r0 *database.User, r1 error) {
  100. return
  101. },
  102. },
  103. GetUserByUsernameFunc: &StoreGetUserByUsernameFunc{
  104. defaultHook: func(context.Context, string) (r0 *database.User, r1 error) {
  105. return
  106. },
  107. },
  108. IsTwoFactorEnabledFunc: &StoreIsTwoFactorEnabledFunc{
  109. defaultHook: func(context.Context, int64) (r0 bool) {
  110. return
  111. },
  112. },
  113. TouchAccessTokenByIDFunc: &StoreTouchAccessTokenByIDFunc{
  114. defaultHook: func(context.Context, int64) (r0 error) {
  115. return
  116. },
  117. },
  118. }
  119. }
  120. // NewStrictMockStore creates a new mock of the Store interface. All methods
  121. // panic on invocation, unless overwritten.
  122. func NewStrictMockStore() *MockStore {
  123. return &MockStore{
  124. AuthenticateUserFunc: &StoreAuthenticateUserFunc{
  125. defaultHook: func(context.Context, string, string, int64) (*database.User, error) {
  126. panic("unexpected invocation of MockStore.AuthenticateUser")
  127. },
  128. },
  129. AuthorizeRepositoryAccessFunc: &StoreAuthorizeRepositoryAccessFunc{
  130. defaultHook: func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool {
  131. panic("unexpected invocation of MockStore.AuthorizeRepositoryAccess")
  132. },
  133. },
  134. CreateLFSObjectFunc: &StoreCreateLFSObjectFunc{
  135. defaultHook: func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error {
  136. panic("unexpected invocation of MockStore.CreateLFSObject")
  137. },
  138. },
  139. CreateUserFunc: &StoreCreateUserFunc{
  140. defaultHook: func(context.Context, string, string, database.CreateUserOptions) (*database.User, error) {
  141. panic("unexpected invocation of MockStore.CreateUser")
  142. },
  143. },
  144. GetAccessTokenBySHA1Func: &StoreGetAccessTokenBySHA1Func{
  145. defaultHook: func(context.Context, string) (*database.AccessToken, error) {
  146. panic("unexpected invocation of MockStore.GetAccessTokenBySHA1")
  147. },
  148. },
  149. GetLFSObjectByOIDFunc: &StoreGetLFSObjectByOIDFunc{
  150. defaultHook: func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error) {
  151. panic("unexpected invocation of MockStore.GetLFSObjectByOID")
  152. },
  153. },
  154. GetLFSObjectsByOIDsFunc: &StoreGetLFSObjectsByOIDsFunc{
  155. defaultHook: func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error) {
  156. panic("unexpected invocation of MockStore.GetLFSObjectsByOIDs")
  157. },
  158. },
  159. GetRepositoryByNameFunc: &StoreGetRepositoryByNameFunc{
  160. defaultHook: func(context.Context, int64, string) (*database.Repository, error) {
  161. panic("unexpected invocation of MockStore.GetRepositoryByName")
  162. },
  163. },
  164. GetUserByIDFunc: &StoreGetUserByIDFunc{
  165. defaultHook: func(context.Context, int64) (*database.User, error) {
  166. panic("unexpected invocation of MockStore.GetUserByID")
  167. },
  168. },
  169. GetUserByUsernameFunc: &StoreGetUserByUsernameFunc{
  170. defaultHook: func(context.Context, string) (*database.User, error) {
  171. panic("unexpected invocation of MockStore.GetUserByUsername")
  172. },
  173. },
  174. IsTwoFactorEnabledFunc: &StoreIsTwoFactorEnabledFunc{
  175. defaultHook: func(context.Context, int64) bool {
  176. panic("unexpected invocation of MockStore.IsTwoFactorEnabled")
  177. },
  178. },
  179. TouchAccessTokenByIDFunc: &StoreTouchAccessTokenByIDFunc{
  180. defaultHook: func(context.Context, int64) error {
  181. panic("unexpected invocation of MockStore.TouchAccessTokenByID")
  182. },
  183. },
  184. }
  185. }
  186. // NewMockStoreFrom creates a new mock of the MockStore interface. All
  187. // methods delegate to the given implementation, unless overwritten.
  188. func NewMockStoreFrom(i Store) *MockStore {
  189. return &MockStore{
  190. AuthenticateUserFunc: &StoreAuthenticateUserFunc{
  191. defaultHook: i.AuthenticateUser,
  192. },
  193. AuthorizeRepositoryAccessFunc: &StoreAuthorizeRepositoryAccessFunc{
  194. defaultHook: i.AuthorizeRepositoryAccess,
  195. },
  196. CreateLFSObjectFunc: &StoreCreateLFSObjectFunc{
  197. defaultHook: i.CreateLFSObject,
  198. },
  199. CreateUserFunc: &StoreCreateUserFunc{
  200. defaultHook: i.CreateUser,
  201. },
  202. GetAccessTokenBySHA1Func: &StoreGetAccessTokenBySHA1Func{
  203. defaultHook: i.GetAccessTokenBySHA1,
  204. },
  205. GetLFSObjectByOIDFunc: &StoreGetLFSObjectByOIDFunc{
  206. defaultHook: i.GetLFSObjectByOID,
  207. },
  208. GetLFSObjectsByOIDsFunc: &StoreGetLFSObjectsByOIDsFunc{
  209. defaultHook: i.GetLFSObjectsByOIDs,
  210. },
  211. GetRepositoryByNameFunc: &StoreGetRepositoryByNameFunc{
  212. defaultHook: i.GetRepositoryByName,
  213. },
  214. GetUserByIDFunc: &StoreGetUserByIDFunc{
  215. defaultHook: i.GetUserByID,
  216. },
  217. GetUserByUsernameFunc: &StoreGetUserByUsernameFunc{
  218. defaultHook: i.GetUserByUsername,
  219. },
  220. IsTwoFactorEnabledFunc: &StoreIsTwoFactorEnabledFunc{
  221. defaultHook: i.IsTwoFactorEnabled,
  222. },
  223. TouchAccessTokenByIDFunc: &StoreTouchAccessTokenByIDFunc{
  224. defaultHook: i.TouchAccessTokenByID,
  225. },
  226. }
  227. }
  228. // StoreAuthenticateUserFunc describes the behavior when the
  229. // AuthenticateUser method of the parent MockStore instance is invoked.
  230. type StoreAuthenticateUserFunc struct {
  231. defaultHook func(context.Context, string, string, int64) (*database.User, error)
  232. hooks []func(context.Context, string, string, int64) (*database.User, error)
  233. history []StoreAuthenticateUserFuncCall
  234. mutex sync.Mutex
  235. }
  236. // AuthenticateUser delegates to the next hook function in the queue and
  237. // stores the parameter and result values of this invocation.
  238. func (m *MockStore) AuthenticateUser(v0 context.Context, v1 string, v2 string, v3 int64) (*database.User, error) {
  239. r0, r1 := m.AuthenticateUserFunc.nextHook()(v0, v1, v2, v3)
  240. m.AuthenticateUserFunc.appendCall(StoreAuthenticateUserFuncCall{v0, v1, v2, v3, r0, r1})
  241. return r0, r1
  242. }
  243. // SetDefaultHook sets function that is called when the AuthenticateUser
  244. // method of the parent MockStore instance is invoked and the hook queue is
  245. // empty.
  246. func (f *StoreAuthenticateUserFunc) SetDefaultHook(hook func(context.Context, string, string, int64) (*database.User, error)) {
  247. f.defaultHook = hook
  248. }
  249. // PushHook adds a function to the end of hook queue. Each invocation of the
  250. // AuthenticateUser method of the parent MockStore instance invokes the hook
  251. // at the front of the queue and discards it. After the queue is empty, the
  252. // default hook function is invoked for any future action.
  253. func (f *StoreAuthenticateUserFunc) PushHook(hook func(context.Context, string, string, int64) (*database.User, error)) {
  254. f.mutex.Lock()
  255. f.hooks = append(f.hooks, hook)
  256. f.mutex.Unlock()
  257. }
  258. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  259. // given values.
  260. func (f *StoreAuthenticateUserFunc) SetDefaultReturn(r0 *database.User, r1 error) {
  261. f.SetDefaultHook(func(context.Context, string, string, int64) (*database.User, error) {
  262. return r0, r1
  263. })
  264. }
  265. // PushReturn calls PushHook with a function that returns the given values.
  266. func (f *StoreAuthenticateUserFunc) PushReturn(r0 *database.User, r1 error) {
  267. f.PushHook(func(context.Context, string, string, int64) (*database.User, error) {
  268. return r0, r1
  269. })
  270. }
  271. func (f *StoreAuthenticateUserFunc) nextHook() func(context.Context, string, string, int64) (*database.User, error) {
  272. f.mutex.Lock()
  273. defer f.mutex.Unlock()
  274. if len(f.hooks) == 0 {
  275. return f.defaultHook
  276. }
  277. hook := f.hooks[0]
  278. f.hooks = f.hooks[1:]
  279. return hook
  280. }
  281. func (f *StoreAuthenticateUserFunc) appendCall(r0 StoreAuthenticateUserFuncCall) {
  282. f.mutex.Lock()
  283. f.history = append(f.history, r0)
  284. f.mutex.Unlock()
  285. }
  286. // History returns a sequence of StoreAuthenticateUserFuncCall objects
  287. // describing the invocations of this function.
  288. func (f *StoreAuthenticateUserFunc) History() []StoreAuthenticateUserFuncCall {
  289. f.mutex.Lock()
  290. history := make([]StoreAuthenticateUserFuncCall, len(f.history))
  291. copy(history, f.history)
  292. f.mutex.Unlock()
  293. return history
  294. }
  295. // StoreAuthenticateUserFuncCall is an object that describes an invocation
  296. // of method AuthenticateUser on an instance of MockStore.
  297. type StoreAuthenticateUserFuncCall struct {
  298. // Arg0 is the value of the 1st argument passed to this method
  299. // invocation.
  300. Arg0 context.Context
  301. // Arg1 is the value of the 2nd argument passed to this method
  302. // invocation.
  303. Arg1 string
  304. // Arg2 is the value of the 3rd argument passed to this method
  305. // invocation.
  306. Arg2 string
  307. // Arg3 is the value of the 4th argument passed to this method
  308. // invocation.
  309. Arg3 int64
  310. // Result0 is the value of the 1st result returned from this method
  311. // invocation.
  312. Result0 *database.User
  313. // Result1 is the value of the 2nd result returned from this method
  314. // invocation.
  315. Result1 error
  316. }
  317. // Args returns an interface slice containing the arguments of this
  318. // invocation.
  319. func (c StoreAuthenticateUserFuncCall) Args() []interface{} {
  320. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3}
  321. }
  322. // Results returns an interface slice containing the results of this
  323. // invocation.
  324. func (c StoreAuthenticateUserFuncCall) Results() []interface{} {
  325. return []interface{}{c.Result0, c.Result1}
  326. }
  327. // StoreAuthorizeRepositoryAccessFunc describes the behavior when the
  328. // AuthorizeRepositoryAccess method of the parent MockStore instance is
  329. // invoked.
  330. type StoreAuthorizeRepositoryAccessFunc struct {
  331. defaultHook func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool
  332. hooks []func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool
  333. history []StoreAuthorizeRepositoryAccessFuncCall
  334. mutex sync.Mutex
  335. }
  336. // AuthorizeRepositoryAccess delegates to the next hook function in the
  337. // queue and stores the parameter and result values of this invocation.
  338. func (m *MockStore) AuthorizeRepositoryAccess(v0 context.Context, v1 int64, v2 int64, v3 database.AccessMode, v4 database.AccessModeOptions) bool {
  339. r0 := m.AuthorizeRepositoryAccessFunc.nextHook()(v0, v1, v2, v3, v4)
  340. m.AuthorizeRepositoryAccessFunc.appendCall(StoreAuthorizeRepositoryAccessFuncCall{v0, v1, v2, v3, v4, r0})
  341. return r0
  342. }
  343. // SetDefaultHook sets function that is called when the
  344. // AuthorizeRepositoryAccess method of the parent MockStore instance is
  345. // invoked and the hook queue is empty.
  346. func (f *StoreAuthorizeRepositoryAccessFunc) SetDefaultHook(hook func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool) {
  347. f.defaultHook = hook
  348. }
  349. // PushHook adds a function to the end of hook queue. Each invocation of the
  350. // AuthorizeRepositoryAccess method of the parent MockStore instance invokes
  351. // the hook at the front of the queue and discards it. After the queue is
  352. // empty, the default hook function is invoked for any future action.
  353. func (f *StoreAuthorizeRepositoryAccessFunc) PushHook(hook func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool) {
  354. f.mutex.Lock()
  355. f.hooks = append(f.hooks, hook)
  356. f.mutex.Unlock()
  357. }
  358. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  359. // given values.
  360. func (f *StoreAuthorizeRepositoryAccessFunc) SetDefaultReturn(r0 bool) {
  361. f.SetDefaultHook(func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool {
  362. return r0
  363. })
  364. }
  365. // PushReturn calls PushHook with a function that returns the given values.
  366. func (f *StoreAuthorizeRepositoryAccessFunc) PushReturn(r0 bool) {
  367. f.PushHook(func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool {
  368. return r0
  369. })
  370. }
  371. func (f *StoreAuthorizeRepositoryAccessFunc) nextHook() func(context.Context, int64, int64, database.AccessMode, database.AccessModeOptions) bool {
  372. f.mutex.Lock()
  373. defer f.mutex.Unlock()
  374. if len(f.hooks) == 0 {
  375. return f.defaultHook
  376. }
  377. hook := f.hooks[0]
  378. f.hooks = f.hooks[1:]
  379. return hook
  380. }
  381. func (f *StoreAuthorizeRepositoryAccessFunc) appendCall(r0 StoreAuthorizeRepositoryAccessFuncCall) {
  382. f.mutex.Lock()
  383. f.history = append(f.history, r0)
  384. f.mutex.Unlock()
  385. }
  386. // History returns a sequence of StoreAuthorizeRepositoryAccessFuncCall
  387. // objects describing the invocations of this function.
  388. func (f *StoreAuthorizeRepositoryAccessFunc) History() []StoreAuthorizeRepositoryAccessFuncCall {
  389. f.mutex.Lock()
  390. history := make([]StoreAuthorizeRepositoryAccessFuncCall, len(f.history))
  391. copy(history, f.history)
  392. f.mutex.Unlock()
  393. return history
  394. }
  395. // StoreAuthorizeRepositoryAccessFuncCall is an object that describes an
  396. // invocation of method AuthorizeRepositoryAccess on an instance of
  397. // MockStore.
  398. type StoreAuthorizeRepositoryAccessFuncCall struct {
  399. // Arg0 is the value of the 1st argument passed to this method
  400. // invocation.
  401. Arg0 context.Context
  402. // Arg1 is the value of the 2nd argument passed to this method
  403. // invocation.
  404. Arg1 int64
  405. // Arg2 is the value of the 3rd argument passed to this method
  406. // invocation.
  407. Arg2 int64
  408. // Arg3 is the value of the 4th argument passed to this method
  409. // invocation.
  410. Arg3 database.AccessMode
  411. // Arg4 is the value of the 5th argument passed to this method
  412. // invocation.
  413. Arg4 database.AccessModeOptions
  414. // Result0 is the value of the 1st result returned from this method
  415. // invocation.
  416. Result0 bool
  417. }
  418. // Args returns an interface slice containing the arguments of this
  419. // invocation.
  420. func (c StoreAuthorizeRepositoryAccessFuncCall) Args() []interface{} {
  421. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4}
  422. }
  423. // Results returns an interface slice containing the results of this
  424. // invocation.
  425. func (c StoreAuthorizeRepositoryAccessFuncCall) Results() []interface{} {
  426. return []interface{}{c.Result0}
  427. }
  428. // StoreCreateLFSObjectFunc describes the behavior when the CreateLFSObject
  429. // method of the parent MockStore instance is invoked.
  430. type StoreCreateLFSObjectFunc struct {
  431. defaultHook func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error
  432. hooks []func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error
  433. history []StoreCreateLFSObjectFuncCall
  434. mutex sync.Mutex
  435. }
  436. // CreateLFSObject delegates to the next hook function in the queue and
  437. // stores the parameter and result values of this invocation.
  438. func (m *MockStore) CreateLFSObject(v0 context.Context, v1 int64, v2 lfsutil.OID, v3 int64, v4 lfsutil.Storage) error {
  439. r0 := m.CreateLFSObjectFunc.nextHook()(v0, v1, v2, v3, v4)
  440. m.CreateLFSObjectFunc.appendCall(StoreCreateLFSObjectFuncCall{v0, v1, v2, v3, v4, r0})
  441. return r0
  442. }
  443. // SetDefaultHook sets function that is called when the CreateLFSObject
  444. // method of the parent MockStore instance is invoked and the hook queue is
  445. // empty.
  446. func (f *StoreCreateLFSObjectFunc) SetDefaultHook(hook func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error) {
  447. f.defaultHook = hook
  448. }
  449. // PushHook adds a function to the end of hook queue. Each invocation of the
  450. // CreateLFSObject method of the parent MockStore instance invokes the hook
  451. // at the front of the queue and discards it. After the queue is empty, the
  452. // default hook function is invoked for any future action.
  453. func (f *StoreCreateLFSObjectFunc) PushHook(hook func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error) {
  454. f.mutex.Lock()
  455. f.hooks = append(f.hooks, hook)
  456. f.mutex.Unlock()
  457. }
  458. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  459. // given values.
  460. func (f *StoreCreateLFSObjectFunc) SetDefaultReturn(r0 error) {
  461. f.SetDefaultHook(func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error {
  462. return r0
  463. })
  464. }
  465. // PushReturn calls PushHook with a function that returns the given values.
  466. func (f *StoreCreateLFSObjectFunc) PushReturn(r0 error) {
  467. f.PushHook(func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error {
  468. return r0
  469. })
  470. }
  471. func (f *StoreCreateLFSObjectFunc) nextHook() func(context.Context, int64, lfsutil.OID, int64, lfsutil.Storage) error {
  472. f.mutex.Lock()
  473. defer f.mutex.Unlock()
  474. if len(f.hooks) == 0 {
  475. return f.defaultHook
  476. }
  477. hook := f.hooks[0]
  478. f.hooks = f.hooks[1:]
  479. return hook
  480. }
  481. func (f *StoreCreateLFSObjectFunc) appendCall(r0 StoreCreateLFSObjectFuncCall) {
  482. f.mutex.Lock()
  483. f.history = append(f.history, r0)
  484. f.mutex.Unlock()
  485. }
  486. // History returns a sequence of StoreCreateLFSObjectFuncCall objects
  487. // describing the invocations of this function.
  488. func (f *StoreCreateLFSObjectFunc) History() []StoreCreateLFSObjectFuncCall {
  489. f.mutex.Lock()
  490. history := make([]StoreCreateLFSObjectFuncCall, len(f.history))
  491. copy(history, f.history)
  492. f.mutex.Unlock()
  493. return history
  494. }
  495. // StoreCreateLFSObjectFuncCall is an object that describes an invocation of
  496. // method CreateLFSObject on an instance of MockStore.
  497. type StoreCreateLFSObjectFuncCall struct {
  498. // Arg0 is the value of the 1st argument passed to this method
  499. // invocation.
  500. Arg0 context.Context
  501. // Arg1 is the value of the 2nd argument passed to this method
  502. // invocation.
  503. Arg1 int64
  504. // Arg2 is the value of the 3rd argument passed to this method
  505. // invocation.
  506. Arg2 lfsutil.OID
  507. // Arg3 is the value of the 4th argument passed to this method
  508. // invocation.
  509. Arg3 int64
  510. // Arg4 is the value of the 5th argument passed to this method
  511. // invocation.
  512. Arg4 lfsutil.Storage
  513. // Result0 is the value of the 1st result returned from this method
  514. // invocation.
  515. Result0 error
  516. }
  517. // Args returns an interface slice containing the arguments of this
  518. // invocation.
  519. func (c StoreCreateLFSObjectFuncCall) Args() []interface{} {
  520. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3, c.Arg4}
  521. }
  522. // Results returns an interface slice containing the results of this
  523. // invocation.
  524. func (c StoreCreateLFSObjectFuncCall) Results() []interface{} {
  525. return []interface{}{c.Result0}
  526. }
  527. // StoreCreateUserFunc describes the behavior when the CreateUser method of
  528. // the parent MockStore instance is invoked.
  529. type StoreCreateUserFunc struct {
  530. defaultHook func(context.Context, string, string, database.CreateUserOptions) (*database.User, error)
  531. hooks []func(context.Context, string, string, database.CreateUserOptions) (*database.User, error)
  532. history []StoreCreateUserFuncCall
  533. mutex sync.Mutex
  534. }
  535. // CreateUser delegates to the next hook function in the queue and stores
  536. // the parameter and result values of this invocation.
  537. func (m *MockStore) CreateUser(v0 context.Context, v1 string, v2 string, v3 database.CreateUserOptions) (*database.User, error) {
  538. r0, r1 := m.CreateUserFunc.nextHook()(v0, v1, v2, v3)
  539. m.CreateUserFunc.appendCall(StoreCreateUserFuncCall{v0, v1, v2, v3, r0, r1})
  540. return r0, r1
  541. }
  542. // SetDefaultHook sets function that is called when the CreateUser method of
  543. // the parent MockStore instance is invoked and the hook queue is empty.
  544. func (f *StoreCreateUserFunc) SetDefaultHook(hook func(context.Context, string, string, database.CreateUserOptions) (*database.User, error)) {
  545. f.defaultHook = hook
  546. }
  547. // PushHook adds a function to the end of hook queue. Each invocation of the
  548. // CreateUser method of the parent MockStore instance invokes the hook at
  549. // the front of the queue and discards it. After the queue is empty, the
  550. // default hook function is invoked for any future action.
  551. func (f *StoreCreateUserFunc) PushHook(hook func(context.Context, string, string, database.CreateUserOptions) (*database.User, error)) {
  552. f.mutex.Lock()
  553. f.hooks = append(f.hooks, hook)
  554. f.mutex.Unlock()
  555. }
  556. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  557. // given values.
  558. func (f *StoreCreateUserFunc) SetDefaultReturn(r0 *database.User, r1 error) {
  559. f.SetDefaultHook(func(context.Context, string, string, database.CreateUserOptions) (*database.User, error) {
  560. return r0, r1
  561. })
  562. }
  563. // PushReturn calls PushHook with a function that returns the given values.
  564. func (f *StoreCreateUserFunc) PushReturn(r0 *database.User, r1 error) {
  565. f.PushHook(func(context.Context, string, string, database.CreateUserOptions) (*database.User, error) {
  566. return r0, r1
  567. })
  568. }
  569. func (f *StoreCreateUserFunc) nextHook() func(context.Context, string, string, database.CreateUserOptions) (*database.User, error) {
  570. f.mutex.Lock()
  571. defer f.mutex.Unlock()
  572. if len(f.hooks) == 0 {
  573. return f.defaultHook
  574. }
  575. hook := f.hooks[0]
  576. f.hooks = f.hooks[1:]
  577. return hook
  578. }
  579. func (f *StoreCreateUserFunc) appendCall(r0 StoreCreateUserFuncCall) {
  580. f.mutex.Lock()
  581. f.history = append(f.history, r0)
  582. f.mutex.Unlock()
  583. }
  584. // History returns a sequence of StoreCreateUserFuncCall objects describing
  585. // the invocations of this function.
  586. func (f *StoreCreateUserFunc) History() []StoreCreateUserFuncCall {
  587. f.mutex.Lock()
  588. history := make([]StoreCreateUserFuncCall, len(f.history))
  589. copy(history, f.history)
  590. f.mutex.Unlock()
  591. return history
  592. }
  593. // StoreCreateUserFuncCall is an object that describes an invocation of
  594. // method CreateUser on an instance of MockStore.
  595. type StoreCreateUserFuncCall struct {
  596. // Arg0 is the value of the 1st argument passed to this method
  597. // invocation.
  598. Arg0 context.Context
  599. // Arg1 is the value of the 2nd argument passed to this method
  600. // invocation.
  601. Arg1 string
  602. // Arg2 is the value of the 3rd argument passed to this method
  603. // invocation.
  604. Arg2 string
  605. // Arg3 is the value of the 4th argument passed to this method
  606. // invocation.
  607. Arg3 database.CreateUserOptions
  608. // Result0 is the value of the 1st result returned from this method
  609. // invocation.
  610. Result0 *database.User
  611. // Result1 is the value of the 2nd result returned from this method
  612. // invocation.
  613. Result1 error
  614. }
  615. // Args returns an interface slice containing the arguments of this
  616. // invocation.
  617. func (c StoreCreateUserFuncCall) Args() []interface{} {
  618. return []interface{}{c.Arg0, c.Arg1, c.Arg2, c.Arg3}
  619. }
  620. // Results returns an interface slice containing the results of this
  621. // invocation.
  622. func (c StoreCreateUserFuncCall) Results() []interface{} {
  623. return []interface{}{c.Result0, c.Result1}
  624. }
  625. // StoreGetAccessTokenBySHA1Func describes the behavior when the
  626. // GetAccessTokenBySHA1 method of the parent MockStore instance is invoked.
  627. type StoreGetAccessTokenBySHA1Func struct {
  628. defaultHook func(context.Context, string) (*database.AccessToken, error)
  629. hooks []func(context.Context, string) (*database.AccessToken, error)
  630. history []StoreGetAccessTokenBySHA1FuncCall
  631. mutex sync.Mutex
  632. }
  633. // GetAccessTokenBySHA1 delegates to the next hook function in the queue and
  634. // stores the parameter and result values of this invocation.
  635. func (m *MockStore) GetAccessTokenBySHA1(v0 context.Context, v1 string) (*database.AccessToken, error) {
  636. r0, r1 := m.GetAccessTokenBySHA1Func.nextHook()(v0, v1)
  637. m.GetAccessTokenBySHA1Func.appendCall(StoreGetAccessTokenBySHA1FuncCall{v0, v1, r0, r1})
  638. return r0, r1
  639. }
  640. // SetDefaultHook sets function that is called when the GetAccessTokenBySHA1
  641. // method of the parent MockStore instance is invoked and the hook queue is
  642. // empty.
  643. func (f *StoreGetAccessTokenBySHA1Func) SetDefaultHook(hook func(context.Context, string) (*database.AccessToken, error)) {
  644. f.defaultHook = hook
  645. }
  646. // PushHook adds a function to the end of hook queue. Each invocation of the
  647. // GetAccessTokenBySHA1 method of the parent MockStore instance invokes the
  648. // hook at the front of the queue and discards it. After the queue is empty,
  649. // the default hook function is invoked for any future action.
  650. func (f *StoreGetAccessTokenBySHA1Func) PushHook(hook func(context.Context, string) (*database.AccessToken, error)) {
  651. f.mutex.Lock()
  652. f.hooks = append(f.hooks, hook)
  653. f.mutex.Unlock()
  654. }
  655. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  656. // given values.
  657. func (f *StoreGetAccessTokenBySHA1Func) SetDefaultReturn(r0 *database.AccessToken, r1 error) {
  658. f.SetDefaultHook(func(context.Context, string) (*database.AccessToken, error) {
  659. return r0, r1
  660. })
  661. }
  662. // PushReturn calls PushHook with a function that returns the given values.
  663. func (f *StoreGetAccessTokenBySHA1Func) PushReturn(r0 *database.AccessToken, r1 error) {
  664. f.PushHook(func(context.Context, string) (*database.AccessToken, error) {
  665. return r0, r1
  666. })
  667. }
  668. func (f *StoreGetAccessTokenBySHA1Func) nextHook() func(context.Context, string) (*database.AccessToken, error) {
  669. f.mutex.Lock()
  670. defer f.mutex.Unlock()
  671. if len(f.hooks) == 0 {
  672. return f.defaultHook
  673. }
  674. hook := f.hooks[0]
  675. f.hooks = f.hooks[1:]
  676. return hook
  677. }
  678. func (f *StoreGetAccessTokenBySHA1Func) appendCall(r0 StoreGetAccessTokenBySHA1FuncCall) {
  679. f.mutex.Lock()
  680. f.history = append(f.history, r0)
  681. f.mutex.Unlock()
  682. }
  683. // History returns a sequence of StoreGetAccessTokenBySHA1FuncCall objects
  684. // describing the invocations of this function.
  685. func (f *StoreGetAccessTokenBySHA1Func) History() []StoreGetAccessTokenBySHA1FuncCall {
  686. f.mutex.Lock()
  687. history := make([]StoreGetAccessTokenBySHA1FuncCall, len(f.history))
  688. copy(history, f.history)
  689. f.mutex.Unlock()
  690. return history
  691. }
  692. // StoreGetAccessTokenBySHA1FuncCall is an object that describes an
  693. // invocation of method GetAccessTokenBySHA1 on an instance of MockStore.
  694. type StoreGetAccessTokenBySHA1FuncCall struct {
  695. // Arg0 is the value of the 1st argument passed to this method
  696. // invocation.
  697. Arg0 context.Context
  698. // Arg1 is the value of the 2nd argument passed to this method
  699. // invocation.
  700. Arg1 string
  701. // Result0 is the value of the 1st result returned from this method
  702. // invocation.
  703. Result0 *database.AccessToken
  704. // Result1 is the value of the 2nd result returned from this method
  705. // invocation.
  706. Result1 error
  707. }
  708. // Args returns an interface slice containing the arguments of this
  709. // invocation.
  710. func (c StoreGetAccessTokenBySHA1FuncCall) Args() []interface{} {
  711. return []interface{}{c.Arg0, c.Arg1}
  712. }
  713. // Results returns an interface slice containing the results of this
  714. // invocation.
  715. func (c StoreGetAccessTokenBySHA1FuncCall) Results() []interface{} {
  716. return []interface{}{c.Result0, c.Result1}
  717. }
  718. // StoreGetLFSObjectByOIDFunc describes the behavior when the
  719. // GetLFSObjectByOID method of the parent MockStore instance is invoked.
  720. type StoreGetLFSObjectByOIDFunc struct {
  721. defaultHook func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error)
  722. hooks []func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error)
  723. history []StoreGetLFSObjectByOIDFuncCall
  724. mutex sync.Mutex
  725. }
  726. // GetLFSObjectByOID delegates to the next hook function in the queue and
  727. // stores the parameter and result values of this invocation.
  728. func (m *MockStore) GetLFSObjectByOID(v0 context.Context, v1 int64, v2 lfsutil.OID) (*database.LFSObject, error) {
  729. r0, r1 := m.GetLFSObjectByOIDFunc.nextHook()(v0, v1, v2)
  730. m.GetLFSObjectByOIDFunc.appendCall(StoreGetLFSObjectByOIDFuncCall{v0, v1, v2, r0, r1})
  731. return r0, r1
  732. }
  733. // SetDefaultHook sets function that is called when the GetLFSObjectByOID
  734. // method of the parent MockStore instance is invoked and the hook queue is
  735. // empty.
  736. func (f *StoreGetLFSObjectByOIDFunc) SetDefaultHook(hook func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error)) {
  737. f.defaultHook = hook
  738. }
  739. // PushHook adds a function to the end of hook queue. Each invocation of the
  740. // GetLFSObjectByOID method of the parent MockStore instance invokes the
  741. // hook at the front of the queue and discards it. After the queue is empty,
  742. // the default hook function is invoked for any future action.
  743. func (f *StoreGetLFSObjectByOIDFunc) PushHook(hook func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error)) {
  744. f.mutex.Lock()
  745. f.hooks = append(f.hooks, hook)
  746. f.mutex.Unlock()
  747. }
  748. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  749. // given values.
  750. func (f *StoreGetLFSObjectByOIDFunc) SetDefaultReturn(r0 *database.LFSObject, r1 error) {
  751. f.SetDefaultHook(func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error) {
  752. return r0, r1
  753. })
  754. }
  755. // PushReturn calls PushHook with a function that returns the given values.
  756. func (f *StoreGetLFSObjectByOIDFunc) PushReturn(r0 *database.LFSObject, r1 error) {
  757. f.PushHook(func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error) {
  758. return r0, r1
  759. })
  760. }
  761. func (f *StoreGetLFSObjectByOIDFunc) nextHook() func(context.Context, int64, lfsutil.OID) (*database.LFSObject, error) {
  762. f.mutex.Lock()
  763. defer f.mutex.Unlock()
  764. if len(f.hooks) == 0 {
  765. return f.defaultHook
  766. }
  767. hook := f.hooks[0]
  768. f.hooks = f.hooks[1:]
  769. return hook
  770. }
  771. func (f *StoreGetLFSObjectByOIDFunc) appendCall(r0 StoreGetLFSObjectByOIDFuncCall) {
  772. f.mutex.Lock()
  773. f.history = append(f.history, r0)
  774. f.mutex.Unlock()
  775. }
  776. // History returns a sequence of StoreGetLFSObjectByOIDFuncCall objects
  777. // describing the invocations of this function.
  778. func (f *StoreGetLFSObjectByOIDFunc) History() []StoreGetLFSObjectByOIDFuncCall {
  779. f.mutex.Lock()
  780. history := make([]StoreGetLFSObjectByOIDFuncCall, len(f.history))
  781. copy(history, f.history)
  782. f.mutex.Unlock()
  783. return history
  784. }
  785. // StoreGetLFSObjectByOIDFuncCall is an object that describes an invocation
  786. // of method GetLFSObjectByOID on an instance of MockStore.
  787. type StoreGetLFSObjectByOIDFuncCall struct {
  788. // Arg0 is the value of the 1st argument passed to this method
  789. // invocation.
  790. Arg0 context.Context
  791. // Arg1 is the value of the 2nd argument passed to this method
  792. // invocation.
  793. Arg1 int64
  794. // Arg2 is the value of the 3rd argument passed to this method
  795. // invocation.
  796. Arg2 lfsutil.OID
  797. // Result0 is the value of the 1st result returned from this method
  798. // invocation.
  799. Result0 *database.LFSObject
  800. // Result1 is the value of the 2nd result returned from this method
  801. // invocation.
  802. Result1 error
  803. }
  804. // Args returns an interface slice containing the arguments of this
  805. // invocation.
  806. func (c StoreGetLFSObjectByOIDFuncCall) Args() []interface{} {
  807. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  808. }
  809. // Results returns an interface slice containing the results of this
  810. // invocation.
  811. func (c StoreGetLFSObjectByOIDFuncCall) Results() []interface{} {
  812. return []interface{}{c.Result0, c.Result1}
  813. }
  814. // StoreGetLFSObjectsByOIDsFunc describes the behavior when the
  815. // GetLFSObjectsByOIDs method of the parent MockStore instance is invoked.
  816. type StoreGetLFSObjectsByOIDsFunc struct {
  817. defaultHook func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error)
  818. hooks []func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error)
  819. history []StoreGetLFSObjectsByOIDsFuncCall
  820. mutex sync.Mutex
  821. }
  822. // GetLFSObjectsByOIDs delegates to the next hook function in the queue and
  823. // stores the parameter and result values of this invocation.
  824. func (m *MockStore) GetLFSObjectsByOIDs(v0 context.Context, v1 int64, v2 ...lfsutil.OID) ([]*database.LFSObject, error) {
  825. r0, r1 := m.GetLFSObjectsByOIDsFunc.nextHook()(v0, v1, v2...)
  826. m.GetLFSObjectsByOIDsFunc.appendCall(StoreGetLFSObjectsByOIDsFuncCall{v0, v1, v2, r0, r1})
  827. return r0, r1
  828. }
  829. // SetDefaultHook sets function that is called when the GetLFSObjectsByOIDs
  830. // method of the parent MockStore instance is invoked and the hook queue is
  831. // empty.
  832. func (f *StoreGetLFSObjectsByOIDsFunc) SetDefaultHook(hook func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error)) {
  833. f.defaultHook = hook
  834. }
  835. // PushHook adds a function to the end of hook queue. Each invocation of the
  836. // GetLFSObjectsByOIDs method of the parent MockStore instance invokes the
  837. // hook at the front of the queue and discards it. After the queue is empty,
  838. // the default hook function is invoked for any future action.
  839. func (f *StoreGetLFSObjectsByOIDsFunc) PushHook(hook func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error)) {
  840. f.mutex.Lock()
  841. f.hooks = append(f.hooks, hook)
  842. f.mutex.Unlock()
  843. }
  844. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  845. // given values.
  846. func (f *StoreGetLFSObjectsByOIDsFunc) SetDefaultReturn(r0 []*database.LFSObject, r1 error) {
  847. f.SetDefaultHook(func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error) {
  848. return r0, r1
  849. })
  850. }
  851. // PushReturn calls PushHook with a function that returns the given values.
  852. func (f *StoreGetLFSObjectsByOIDsFunc) PushReturn(r0 []*database.LFSObject, r1 error) {
  853. f.PushHook(func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error) {
  854. return r0, r1
  855. })
  856. }
  857. func (f *StoreGetLFSObjectsByOIDsFunc) nextHook() func(context.Context, int64, ...lfsutil.OID) ([]*database.LFSObject, error) {
  858. f.mutex.Lock()
  859. defer f.mutex.Unlock()
  860. if len(f.hooks) == 0 {
  861. return f.defaultHook
  862. }
  863. hook := f.hooks[0]
  864. f.hooks = f.hooks[1:]
  865. return hook
  866. }
  867. func (f *StoreGetLFSObjectsByOIDsFunc) appendCall(r0 StoreGetLFSObjectsByOIDsFuncCall) {
  868. f.mutex.Lock()
  869. f.history = append(f.history, r0)
  870. f.mutex.Unlock()
  871. }
  872. // History returns a sequence of StoreGetLFSObjectsByOIDsFuncCall objects
  873. // describing the invocations of this function.
  874. func (f *StoreGetLFSObjectsByOIDsFunc) History() []StoreGetLFSObjectsByOIDsFuncCall {
  875. f.mutex.Lock()
  876. history := make([]StoreGetLFSObjectsByOIDsFuncCall, len(f.history))
  877. copy(history, f.history)
  878. f.mutex.Unlock()
  879. return history
  880. }
  881. // StoreGetLFSObjectsByOIDsFuncCall is an object that describes an
  882. // invocation of method GetLFSObjectsByOIDs on an instance of MockStore.
  883. type StoreGetLFSObjectsByOIDsFuncCall struct {
  884. // Arg0 is the value of the 1st argument passed to this method
  885. // invocation.
  886. Arg0 context.Context
  887. // Arg1 is the value of the 2nd argument passed to this method
  888. // invocation.
  889. Arg1 int64
  890. // Arg2 is a slice containing the values of the variadic arguments
  891. // passed to this method invocation.
  892. Arg2 []lfsutil.OID
  893. // Result0 is the value of the 1st result returned from this method
  894. // invocation.
  895. Result0 []*database.LFSObject
  896. // Result1 is the value of the 2nd result returned from this method
  897. // invocation.
  898. Result1 error
  899. }
  900. // Args returns an interface slice containing the arguments of this
  901. // invocation. The variadic slice argument is flattened in this array such
  902. // that one positional argument and three variadic arguments would result in
  903. // a slice of four, not two.
  904. func (c StoreGetLFSObjectsByOIDsFuncCall) Args() []interface{} {
  905. trailing := []interface{}{}
  906. for _, val := range c.Arg2 {
  907. trailing = append(trailing, val)
  908. }
  909. return append([]interface{}{c.Arg0, c.Arg1}, trailing...)
  910. }
  911. // Results returns an interface slice containing the results of this
  912. // invocation.
  913. func (c StoreGetLFSObjectsByOIDsFuncCall) Results() []interface{} {
  914. return []interface{}{c.Result0, c.Result1}
  915. }
  916. // StoreGetRepositoryByNameFunc describes the behavior when the
  917. // GetRepositoryByName method of the parent MockStore instance is invoked.
  918. type StoreGetRepositoryByNameFunc struct {
  919. defaultHook func(context.Context, int64, string) (*database.Repository, error)
  920. hooks []func(context.Context, int64, string) (*database.Repository, error)
  921. history []StoreGetRepositoryByNameFuncCall
  922. mutex sync.Mutex
  923. }
  924. // GetRepositoryByName delegates to the next hook function in the queue and
  925. // stores the parameter and result values of this invocation.
  926. func (m *MockStore) GetRepositoryByName(v0 context.Context, v1 int64, v2 string) (*database.Repository, error) {
  927. r0, r1 := m.GetRepositoryByNameFunc.nextHook()(v0, v1, v2)
  928. m.GetRepositoryByNameFunc.appendCall(StoreGetRepositoryByNameFuncCall{v0, v1, v2, r0, r1})
  929. return r0, r1
  930. }
  931. // SetDefaultHook sets function that is called when the GetRepositoryByName
  932. // method of the parent MockStore instance is invoked and the hook queue is
  933. // empty.
  934. func (f *StoreGetRepositoryByNameFunc) SetDefaultHook(hook func(context.Context, int64, string) (*database.Repository, error)) {
  935. f.defaultHook = hook
  936. }
  937. // PushHook adds a function to the end of hook queue. Each invocation of the
  938. // GetRepositoryByName method of the parent MockStore instance invokes the
  939. // hook at the front of the queue and discards it. After the queue is empty,
  940. // the default hook function is invoked for any future action.
  941. func (f *StoreGetRepositoryByNameFunc) PushHook(hook func(context.Context, int64, string) (*database.Repository, error)) {
  942. f.mutex.Lock()
  943. f.hooks = append(f.hooks, hook)
  944. f.mutex.Unlock()
  945. }
  946. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  947. // given values.
  948. func (f *StoreGetRepositoryByNameFunc) SetDefaultReturn(r0 *database.Repository, r1 error) {
  949. f.SetDefaultHook(func(context.Context, int64, string) (*database.Repository, error) {
  950. return r0, r1
  951. })
  952. }
  953. // PushReturn calls PushHook with a function that returns the given values.
  954. func (f *StoreGetRepositoryByNameFunc) PushReturn(r0 *database.Repository, r1 error) {
  955. f.PushHook(func(context.Context, int64, string) (*database.Repository, error) {
  956. return r0, r1
  957. })
  958. }
  959. func (f *StoreGetRepositoryByNameFunc) nextHook() func(context.Context, int64, string) (*database.Repository, error) {
  960. f.mutex.Lock()
  961. defer f.mutex.Unlock()
  962. if len(f.hooks) == 0 {
  963. return f.defaultHook
  964. }
  965. hook := f.hooks[0]
  966. f.hooks = f.hooks[1:]
  967. return hook
  968. }
  969. func (f *StoreGetRepositoryByNameFunc) appendCall(r0 StoreGetRepositoryByNameFuncCall) {
  970. f.mutex.Lock()
  971. f.history = append(f.history, r0)
  972. f.mutex.Unlock()
  973. }
  974. // History returns a sequence of StoreGetRepositoryByNameFuncCall objects
  975. // describing the invocations of this function.
  976. func (f *StoreGetRepositoryByNameFunc) History() []StoreGetRepositoryByNameFuncCall {
  977. f.mutex.Lock()
  978. history := make([]StoreGetRepositoryByNameFuncCall, len(f.history))
  979. copy(history, f.history)
  980. f.mutex.Unlock()
  981. return history
  982. }
  983. // StoreGetRepositoryByNameFuncCall is an object that describes an
  984. // invocation of method GetRepositoryByName on an instance of MockStore.
  985. type StoreGetRepositoryByNameFuncCall struct {
  986. // Arg0 is the value of the 1st argument passed to this method
  987. // invocation.
  988. Arg0 context.Context
  989. // Arg1 is the value of the 2nd argument passed to this method
  990. // invocation.
  991. Arg1 int64
  992. // Arg2 is the value of the 3rd argument passed to this method
  993. // invocation.
  994. Arg2 string
  995. // Result0 is the value of the 1st result returned from this method
  996. // invocation.
  997. Result0 *database.Repository
  998. // Result1 is the value of the 2nd result returned from this method
  999. // invocation.
  1000. Result1 error
  1001. }
  1002. // Args returns an interface slice containing the arguments of this
  1003. // invocation.
  1004. func (c StoreGetRepositoryByNameFuncCall) Args() []interface{} {
  1005. return []interface{}{c.Arg0, c.Arg1, c.Arg2}
  1006. }
  1007. // Results returns an interface slice containing the results of this
  1008. // invocation.
  1009. func (c StoreGetRepositoryByNameFuncCall) Results() []interface{} {
  1010. return []interface{}{c.Result0, c.Result1}
  1011. }
  1012. // StoreGetUserByIDFunc describes the behavior when the GetUserByID method
  1013. // of the parent MockStore instance is invoked.
  1014. type StoreGetUserByIDFunc struct {
  1015. defaultHook func(context.Context, int64) (*database.User, error)
  1016. hooks []func(context.Context, int64) (*database.User, error)
  1017. history []StoreGetUserByIDFuncCall
  1018. mutex sync.Mutex
  1019. }
  1020. // GetUserByID delegates to the next hook function in the queue and stores
  1021. // the parameter and result values of this invocation.
  1022. func (m *MockStore) GetUserByID(v0 context.Context, v1 int64) (*database.User, error) {
  1023. r0, r1 := m.GetUserByIDFunc.nextHook()(v0, v1)
  1024. m.GetUserByIDFunc.appendCall(StoreGetUserByIDFuncCall{v0, v1, r0, r1})
  1025. return r0, r1
  1026. }
  1027. // SetDefaultHook sets function that is called when the GetUserByID method
  1028. // of the parent MockStore instance is invoked and the hook queue is empty.
  1029. func (f *StoreGetUserByIDFunc) SetDefaultHook(hook func(context.Context, int64) (*database.User, error)) {
  1030. f.defaultHook = hook
  1031. }
  1032. // PushHook adds a function to the end of hook queue. Each invocation of the
  1033. // GetUserByID method of the parent MockStore instance invokes the hook at
  1034. // the front of the queue and discards it. After the queue is empty, the
  1035. // default hook function is invoked for any future action.
  1036. func (f *StoreGetUserByIDFunc) PushHook(hook func(context.Context, int64) (*database.User, error)) {
  1037. f.mutex.Lock()
  1038. f.hooks = append(f.hooks, hook)
  1039. f.mutex.Unlock()
  1040. }
  1041. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1042. // given values.
  1043. func (f *StoreGetUserByIDFunc) SetDefaultReturn(r0 *database.User, r1 error) {
  1044. f.SetDefaultHook(func(context.Context, int64) (*database.User, error) {
  1045. return r0, r1
  1046. })
  1047. }
  1048. // PushReturn calls PushHook with a function that returns the given values.
  1049. func (f *StoreGetUserByIDFunc) PushReturn(r0 *database.User, r1 error) {
  1050. f.PushHook(func(context.Context, int64) (*database.User, error) {
  1051. return r0, r1
  1052. })
  1053. }
  1054. func (f *StoreGetUserByIDFunc) nextHook() func(context.Context, int64) (*database.User, error) {
  1055. f.mutex.Lock()
  1056. defer f.mutex.Unlock()
  1057. if len(f.hooks) == 0 {
  1058. return f.defaultHook
  1059. }
  1060. hook := f.hooks[0]
  1061. f.hooks = f.hooks[1:]
  1062. return hook
  1063. }
  1064. func (f *StoreGetUserByIDFunc) appendCall(r0 StoreGetUserByIDFuncCall) {
  1065. f.mutex.Lock()
  1066. f.history = append(f.history, r0)
  1067. f.mutex.Unlock()
  1068. }
  1069. // History returns a sequence of StoreGetUserByIDFuncCall objects describing
  1070. // the invocations of this function.
  1071. func (f *StoreGetUserByIDFunc) History() []StoreGetUserByIDFuncCall {
  1072. f.mutex.Lock()
  1073. history := make([]StoreGetUserByIDFuncCall, len(f.history))
  1074. copy(history, f.history)
  1075. f.mutex.Unlock()
  1076. return history
  1077. }
  1078. // StoreGetUserByIDFuncCall is an object that describes an invocation of
  1079. // method GetUserByID on an instance of MockStore.
  1080. type StoreGetUserByIDFuncCall struct {
  1081. // Arg0 is the value of the 1st argument passed to this method
  1082. // invocation.
  1083. Arg0 context.Context
  1084. // Arg1 is the value of the 2nd argument passed to this method
  1085. // invocation.
  1086. Arg1 int64
  1087. // Result0 is the value of the 1st result returned from this method
  1088. // invocation.
  1089. Result0 *database.User
  1090. // Result1 is the value of the 2nd result returned from this method
  1091. // invocation.
  1092. Result1 error
  1093. }
  1094. // Args returns an interface slice containing the arguments of this
  1095. // invocation.
  1096. func (c StoreGetUserByIDFuncCall) Args() []interface{} {
  1097. return []interface{}{c.Arg0, c.Arg1}
  1098. }
  1099. // Results returns an interface slice containing the results of this
  1100. // invocation.
  1101. func (c StoreGetUserByIDFuncCall) Results() []interface{} {
  1102. return []interface{}{c.Result0, c.Result1}
  1103. }
  1104. // StoreGetUserByUsernameFunc describes the behavior when the
  1105. // GetUserByUsername method of the parent MockStore instance is invoked.
  1106. type StoreGetUserByUsernameFunc struct {
  1107. defaultHook func(context.Context, string) (*database.User, error)
  1108. hooks []func(context.Context, string) (*database.User, error)
  1109. history []StoreGetUserByUsernameFuncCall
  1110. mutex sync.Mutex
  1111. }
  1112. // GetUserByUsername delegates to the next hook function in the queue and
  1113. // stores the parameter and result values of this invocation.
  1114. func (m *MockStore) GetUserByUsername(v0 context.Context, v1 string) (*database.User, error) {
  1115. r0, r1 := m.GetUserByUsernameFunc.nextHook()(v0, v1)
  1116. m.GetUserByUsernameFunc.appendCall(StoreGetUserByUsernameFuncCall{v0, v1, r0, r1})
  1117. return r0, r1
  1118. }
  1119. // SetDefaultHook sets function that is called when the GetUserByUsername
  1120. // method of the parent MockStore instance is invoked and the hook queue is
  1121. // empty.
  1122. func (f *StoreGetUserByUsernameFunc) SetDefaultHook(hook func(context.Context, string) (*database.User, error)) {
  1123. f.defaultHook = hook
  1124. }
  1125. // PushHook adds a function to the end of hook queue. Each invocation of the
  1126. // GetUserByUsername method of the parent MockStore instance invokes the
  1127. // hook at the front of the queue and discards it. After the queue is empty,
  1128. // the default hook function is invoked for any future action.
  1129. func (f *StoreGetUserByUsernameFunc) PushHook(hook func(context.Context, string) (*database.User, error)) {
  1130. f.mutex.Lock()
  1131. f.hooks = append(f.hooks, hook)
  1132. f.mutex.Unlock()
  1133. }
  1134. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1135. // given values.
  1136. func (f *StoreGetUserByUsernameFunc) SetDefaultReturn(r0 *database.User, r1 error) {
  1137. f.SetDefaultHook(func(context.Context, string) (*database.User, error) {
  1138. return r0, r1
  1139. })
  1140. }
  1141. // PushReturn calls PushHook with a function that returns the given values.
  1142. func (f *StoreGetUserByUsernameFunc) PushReturn(r0 *database.User, r1 error) {
  1143. f.PushHook(func(context.Context, string) (*database.User, error) {
  1144. return r0, r1
  1145. })
  1146. }
  1147. func (f *StoreGetUserByUsernameFunc) nextHook() func(context.Context, string) (*database.User, error) {
  1148. f.mutex.Lock()
  1149. defer f.mutex.Unlock()
  1150. if len(f.hooks) == 0 {
  1151. return f.defaultHook
  1152. }
  1153. hook := f.hooks[0]
  1154. f.hooks = f.hooks[1:]
  1155. return hook
  1156. }
  1157. func (f *StoreGetUserByUsernameFunc) appendCall(r0 StoreGetUserByUsernameFuncCall) {
  1158. f.mutex.Lock()
  1159. f.history = append(f.history, r0)
  1160. f.mutex.Unlock()
  1161. }
  1162. // History returns a sequence of StoreGetUserByUsernameFuncCall objects
  1163. // describing the invocations of this function.
  1164. func (f *StoreGetUserByUsernameFunc) History() []StoreGetUserByUsernameFuncCall {
  1165. f.mutex.Lock()
  1166. history := make([]StoreGetUserByUsernameFuncCall, len(f.history))
  1167. copy(history, f.history)
  1168. f.mutex.Unlock()
  1169. return history
  1170. }
  1171. // StoreGetUserByUsernameFuncCall is an object that describes an invocation
  1172. // of method GetUserByUsername on an instance of MockStore.
  1173. type StoreGetUserByUsernameFuncCall struct {
  1174. // Arg0 is the value of the 1st argument passed to this method
  1175. // invocation.
  1176. Arg0 context.Context
  1177. // Arg1 is the value of the 2nd argument passed to this method
  1178. // invocation.
  1179. Arg1 string
  1180. // Result0 is the value of the 1st result returned from this method
  1181. // invocation.
  1182. Result0 *database.User
  1183. // Result1 is the value of the 2nd result returned from this method
  1184. // invocation.
  1185. Result1 error
  1186. }
  1187. // Args returns an interface slice containing the arguments of this
  1188. // invocation.
  1189. func (c StoreGetUserByUsernameFuncCall) Args() []interface{} {
  1190. return []interface{}{c.Arg0, c.Arg1}
  1191. }
  1192. // Results returns an interface slice containing the results of this
  1193. // invocation.
  1194. func (c StoreGetUserByUsernameFuncCall) Results() []interface{} {
  1195. return []interface{}{c.Result0, c.Result1}
  1196. }
  1197. // StoreIsTwoFactorEnabledFunc describes the behavior when the
  1198. // IsTwoFactorEnabled method of the parent MockStore instance is invoked.
  1199. type StoreIsTwoFactorEnabledFunc struct {
  1200. defaultHook func(context.Context, int64) bool
  1201. hooks []func(context.Context, int64) bool
  1202. history []StoreIsTwoFactorEnabledFuncCall
  1203. mutex sync.Mutex
  1204. }
  1205. // IsTwoFactorEnabled delegates to the next hook function in the queue and
  1206. // stores the parameter and result values of this invocation.
  1207. func (m *MockStore) IsTwoFactorEnabled(v0 context.Context, v1 int64) bool {
  1208. r0 := m.IsTwoFactorEnabledFunc.nextHook()(v0, v1)
  1209. m.IsTwoFactorEnabledFunc.appendCall(StoreIsTwoFactorEnabledFuncCall{v0, v1, r0})
  1210. return r0
  1211. }
  1212. // SetDefaultHook sets function that is called when the IsTwoFactorEnabled
  1213. // method of the parent MockStore instance is invoked and the hook queue is
  1214. // empty.
  1215. func (f *StoreIsTwoFactorEnabledFunc) SetDefaultHook(hook func(context.Context, int64) bool) {
  1216. f.defaultHook = hook
  1217. }
  1218. // PushHook adds a function to the end of hook queue. Each invocation of the
  1219. // IsTwoFactorEnabled method of the parent MockStore instance invokes the
  1220. // hook at the front of the queue and discards it. After the queue is empty,
  1221. // the default hook function is invoked for any future action.
  1222. func (f *StoreIsTwoFactorEnabledFunc) PushHook(hook func(context.Context, int64) bool) {
  1223. f.mutex.Lock()
  1224. f.hooks = append(f.hooks, hook)
  1225. f.mutex.Unlock()
  1226. }
  1227. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1228. // given values.
  1229. func (f *StoreIsTwoFactorEnabledFunc) SetDefaultReturn(r0 bool) {
  1230. f.SetDefaultHook(func(context.Context, int64) bool {
  1231. return r0
  1232. })
  1233. }
  1234. // PushReturn calls PushHook with a function that returns the given values.
  1235. func (f *StoreIsTwoFactorEnabledFunc) PushReturn(r0 bool) {
  1236. f.PushHook(func(context.Context, int64) bool {
  1237. return r0
  1238. })
  1239. }
  1240. func (f *StoreIsTwoFactorEnabledFunc) nextHook() func(context.Context, int64) bool {
  1241. f.mutex.Lock()
  1242. defer f.mutex.Unlock()
  1243. if len(f.hooks) == 0 {
  1244. return f.defaultHook
  1245. }
  1246. hook := f.hooks[0]
  1247. f.hooks = f.hooks[1:]
  1248. return hook
  1249. }
  1250. func (f *StoreIsTwoFactorEnabledFunc) appendCall(r0 StoreIsTwoFactorEnabledFuncCall) {
  1251. f.mutex.Lock()
  1252. f.history = append(f.history, r0)
  1253. f.mutex.Unlock()
  1254. }
  1255. // History returns a sequence of StoreIsTwoFactorEnabledFuncCall objects
  1256. // describing the invocations of this function.
  1257. func (f *StoreIsTwoFactorEnabledFunc) History() []StoreIsTwoFactorEnabledFuncCall {
  1258. f.mutex.Lock()
  1259. history := make([]StoreIsTwoFactorEnabledFuncCall, len(f.history))
  1260. copy(history, f.history)
  1261. f.mutex.Unlock()
  1262. return history
  1263. }
  1264. // StoreIsTwoFactorEnabledFuncCall is an object that describes an invocation
  1265. // of method IsTwoFactorEnabled on an instance of MockStore.
  1266. type StoreIsTwoFactorEnabledFuncCall struct {
  1267. // Arg0 is the value of the 1st argument passed to this method
  1268. // invocation.
  1269. Arg0 context.Context
  1270. // Arg1 is the value of the 2nd argument passed to this method
  1271. // invocation.
  1272. Arg1 int64
  1273. // Result0 is the value of the 1st result returned from this method
  1274. // invocation.
  1275. Result0 bool
  1276. }
  1277. // Args returns an interface slice containing the arguments of this
  1278. // invocation.
  1279. func (c StoreIsTwoFactorEnabledFuncCall) Args() []interface{} {
  1280. return []interface{}{c.Arg0, c.Arg1}
  1281. }
  1282. // Results returns an interface slice containing the results of this
  1283. // invocation.
  1284. func (c StoreIsTwoFactorEnabledFuncCall) Results() []interface{} {
  1285. return []interface{}{c.Result0}
  1286. }
  1287. // StoreTouchAccessTokenByIDFunc describes the behavior when the
  1288. // TouchAccessTokenByID method of the parent MockStore instance is invoked.
  1289. type StoreTouchAccessTokenByIDFunc struct {
  1290. defaultHook func(context.Context, int64) error
  1291. hooks []func(context.Context, int64) error
  1292. history []StoreTouchAccessTokenByIDFuncCall
  1293. mutex sync.Mutex
  1294. }
  1295. // TouchAccessTokenByID delegates to the next hook function in the queue and
  1296. // stores the parameter and result values of this invocation.
  1297. func (m *MockStore) TouchAccessTokenByID(v0 context.Context, v1 int64) error {
  1298. r0 := m.TouchAccessTokenByIDFunc.nextHook()(v0, v1)
  1299. m.TouchAccessTokenByIDFunc.appendCall(StoreTouchAccessTokenByIDFuncCall{v0, v1, r0})
  1300. return r0
  1301. }
  1302. // SetDefaultHook sets function that is called when the TouchAccessTokenByID
  1303. // method of the parent MockStore instance is invoked and the hook queue is
  1304. // empty.
  1305. func (f *StoreTouchAccessTokenByIDFunc) SetDefaultHook(hook func(context.Context, int64) error) {
  1306. f.defaultHook = hook
  1307. }
  1308. // PushHook adds a function to the end of hook queue. Each invocation of the
  1309. // TouchAccessTokenByID method of the parent MockStore instance invokes the
  1310. // hook at the front of the queue and discards it. After the queue is empty,
  1311. // the default hook function is invoked for any future action.
  1312. func (f *StoreTouchAccessTokenByIDFunc) PushHook(hook func(context.Context, int64) error) {
  1313. f.mutex.Lock()
  1314. f.hooks = append(f.hooks, hook)
  1315. f.mutex.Unlock()
  1316. }
  1317. // SetDefaultReturn calls SetDefaultHook with a function that returns the
  1318. // given values.
  1319. func (f *StoreTouchAccessTokenByIDFunc) SetDefaultReturn(r0 error) {
  1320. f.SetDefaultHook(func(context.Context, int64) error {
  1321. return r0
  1322. })
  1323. }
  1324. // PushReturn calls PushHook with a function that returns the given values.
  1325. func (f *StoreTouchAccessTokenByIDFunc) PushReturn(r0 error) {
  1326. f.PushHook(func(context.Context, int64) error {
  1327. return r0
  1328. })
  1329. }
  1330. func (f *StoreTouchAccessTokenByIDFunc) nextHook() func(context.Context, int64) error {
  1331. f.mutex.Lock()
  1332. defer f.mutex.Unlock()
  1333. if len(f.hooks) == 0 {
  1334. return f.defaultHook
  1335. }
  1336. hook := f.hooks[0]
  1337. f.hooks = f.hooks[1:]
  1338. return hook
  1339. }
  1340. func (f *StoreTouchAccessTokenByIDFunc) appendCall(r0 StoreTouchAccessTokenByIDFuncCall) {
  1341. f.mutex.Lock()
  1342. f.history = append(f.history, r0)
  1343. f.mutex.Unlock()
  1344. }
  1345. // History returns a sequence of StoreTouchAccessTokenByIDFuncCall objects
  1346. // describing the invocations of this function.
  1347. func (f *StoreTouchAccessTokenByIDFunc) History() []StoreTouchAccessTokenByIDFuncCall {
  1348. f.mutex.Lock()
  1349. history := make([]StoreTouchAccessTokenByIDFuncCall, len(f.history))
  1350. copy(history, f.history)
  1351. f.mutex.Unlock()
  1352. return history
  1353. }
  1354. // StoreTouchAccessTokenByIDFuncCall is an object that describes an
  1355. // invocation of method TouchAccessTokenByID on an instance of MockStore.
  1356. type StoreTouchAccessTokenByIDFuncCall struct {
  1357. // Arg0 is the value of the 1st argument passed to this method
  1358. // invocation.
  1359. Arg0 context.Context
  1360. // Arg1 is the value of the 2nd argument passed to this method
  1361. // invocation.
  1362. Arg1 int64
  1363. // Result0 is the value of the 1st result returned from this method
  1364. // invocation.
  1365. Result0 error
  1366. }
  1367. // Args returns an interface slice containing the arguments of this
  1368. // invocation.
  1369. func (c StoreTouchAccessTokenByIDFuncCall) Args() []interface{} {
  1370. return []interface{}{c.Arg0, c.Arg1}
  1371. }
  1372. // Results returns an interface slice containing the results of this
  1373. // invocation.
  1374. func (c StoreTouchAccessTokenByIDFuncCall) Results() []interface{} {
  1375. return []interface{}{c.Result0}
  1376. }