mock_bart_asset_manager_test.go 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package http
  5. import (
  6. "context"
  7. "github.com/mk6i/open-oscar-server/state"
  8. mock "github.com/stretchr/testify/mock"
  9. )
  10. // newMockBARTAssetManager creates a new instance of mockBARTAssetManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
  11. // The first argument is typically a *testing.T value.
  12. func newMockBARTAssetManager(t interface {
  13. mock.TestingT
  14. Cleanup(func())
  15. }) *mockBARTAssetManager {
  16. if helper, ok := t.(interface{ Helper() }); ok {
  17. helper.Helper()
  18. }
  19. mock := &mockBARTAssetManager{}
  20. mock.Mock.Test(t)
  21. t.Cleanup(func() {
  22. if helper, ok := t.(interface{ Helper() }); ok {
  23. helper.Helper()
  24. }
  25. mock.AssertExpectations(t)
  26. })
  27. return mock
  28. }
  29. // mockBARTAssetManager is an autogenerated mock type for the BARTAssetManager type
  30. type mockBARTAssetManager struct {
  31. mock.Mock
  32. }
  33. type mockBARTAssetManager_Expecter struct {
  34. mock *mock.Mock
  35. }
  36. func (_m *mockBARTAssetManager) EXPECT() *mockBARTAssetManager_Expecter {
  37. return &mockBARTAssetManager_Expecter{mock: &_m.Mock}
  38. }
  39. // BARTItem provides a mock function for the type mockBARTAssetManager
  40. func (_mock *mockBARTAssetManager) BARTItem(ctx context.Context, hash []byte) ([]byte, error) {
  41. ret := _mock.Called(ctx, hash)
  42. if len(ret) == 0 {
  43. panic("no return value specified for BARTItem")
  44. }
  45. var r0 []byte
  46. var r1 error
  47. if returnFunc, ok := ret.Get(0).(func(context.Context, []byte) ([]byte, error)); ok {
  48. return returnFunc(ctx, hash)
  49. }
  50. if returnFunc, ok := ret.Get(0).(func(context.Context, []byte) []byte); ok {
  51. r0 = returnFunc(ctx, hash)
  52. } else {
  53. if ret.Get(0) != nil {
  54. r0 = ret.Get(0).([]byte)
  55. }
  56. }
  57. if returnFunc, ok := ret.Get(1).(func(context.Context, []byte) error); ok {
  58. r1 = returnFunc(ctx, hash)
  59. } else {
  60. r1 = ret.Error(1)
  61. }
  62. return r0, r1
  63. }
  64. // mockBARTAssetManager_BARTItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BARTItem'
  65. type mockBARTAssetManager_BARTItem_Call struct {
  66. *mock.Call
  67. }
  68. // BARTItem is a helper method to define mock.On call
  69. // - ctx context.Context
  70. // - hash []byte
  71. func (_e *mockBARTAssetManager_Expecter) BARTItem(ctx any, hash any) *mockBARTAssetManager_BARTItem_Call {
  72. return &mockBARTAssetManager_BARTItem_Call{Call: _e.mock.On("BARTItem", ctx, hash)}
  73. }
  74. func (_c *mockBARTAssetManager_BARTItem_Call) Run(run func(ctx context.Context, hash []byte)) *mockBARTAssetManager_BARTItem_Call {
  75. _c.Call.Run(func(args mock.Arguments) {
  76. var arg0 context.Context
  77. if args[0] != nil {
  78. arg0 = args[0].(context.Context)
  79. }
  80. var arg1 []byte
  81. if args[1] != nil {
  82. arg1 = args[1].([]byte)
  83. }
  84. run(
  85. arg0,
  86. arg1,
  87. )
  88. })
  89. return _c
  90. }
  91. func (_c *mockBARTAssetManager_BARTItem_Call) Return(bytes []byte, err error) *mockBARTAssetManager_BARTItem_Call {
  92. _c.Call.Return(bytes, err)
  93. return _c
  94. }
  95. func (_c *mockBARTAssetManager_BARTItem_Call) RunAndReturn(run func(ctx context.Context, hash []byte) ([]byte, error)) *mockBARTAssetManager_BARTItem_Call {
  96. _c.Call.Return(run)
  97. return _c
  98. }
  99. // DeleteBARTItem provides a mock function for the type mockBARTAssetManager
  100. func (_mock *mockBARTAssetManager) DeleteBARTItem(ctx context.Context, hash []byte) error {
  101. ret := _mock.Called(ctx, hash)
  102. if len(ret) == 0 {
  103. panic("no return value specified for DeleteBARTItem")
  104. }
  105. var r0 error
  106. if returnFunc, ok := ret.Get(0).(func(context.Context, []byte) error); ok {
  107. r0 = returnFunc(ctx, hash)
  108. } else {
  109. r0 = ret.Error(0)
  110. }
  111. return r0
  112. }
  113. // mockBARTAssetManager_DeleteBARTItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteBARTItem'
  114. type mockBARTAssetManager_DeleteBARTItem_Call struct {
  115. *mock.Call
  116. }
  117. // DeleteBARTItem is a helper method to define mock.On call
  118. // - ctx context.Context
  119. // - hash []byte
  120. func (_e *mockBARTAssetManager_Expecter) DeleteBARTItem(ctx any, hash any) *mockBARTAssetManager_DeleteBARTItem_Call {
  121. return &mockBARTAssetManager_DeleteBARTItem_Call{Call: _e.mock.On("DeleteBARTItem", ctx, hash)}
  122. }
  123. func (_c *mockBARTAssetManager_DeleteBARTItem_Call) Run(run func(ctx context.Context, hash []byte)) *mockBARTAssetManager_DeleteBARTItem_Call {
  124. _c.Call.Run(func(args mock.Arguments) {
  125. var arg0 context.Context
  126. if args[0] != nil {
  127. arg0 = args[0].(context.Context)
  128. }
  129. var arg1 []byte
  130. if args[1] != nil {
  131. arg1 = args[1].([]byte)
  132. }
  133. run(
  134. arg0,
  135. arg1,
  136. )
  137. })
  138. return _c
  139. }
  140. func (_c *mockBARTAssetManager_DeleteBARTItem_Call) Return(err error) *mockBARTAssetManager_DeleteBARTItem_Call {
  141. _c.Call.Return(err)
  142. return _c
  143. }
  144. func (_c *mockBARTAssetManager_DeleteBARTItem_Call) RunAndReturn(run func(ctx context.Context, hash []byte) error) *mockBARTAssetManager_DeleteBARTItem_Call {
  145. _c.Call.Return(run)
  146. return _c
  147. }
  148. // InsertBARTItem provides a mock function for the type mockBARTAssetManager
  149. func (_mock *mockBARTAssetManager) InsertBARTItem(ctx context.Context, hash []byte, blob []byte, itemType uint16) error {
  150. ret := _mock.Called(ctx, hash, blob, itemType)
  151. if len(ret) == 0 {
  152. panic("no return value specified for InsertBARTItem")
  153. }
  154. var r0 error
  155. if returnFunc, ok := ret.Get(0).(func(context.Context, []byte, []byte, uint16) error); ok {
  156. r0 = returnFunc(ctx, hash, blob, itemType)
  157. } else {
  158. r0 = ret.Error(0)
  159. }
  160. return r0
  161. }
  162. // mockBARTAssetManager_InsertBARTItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertBARTItem'
  163. type mockBARTAssetManager_InsertBARTItem_Call struct {
  164. *mock.Call
  165. }
  166. // InsertBARTItem is a helper method to define mock.On call
  167. // - ctx context.Context
  168. // - hash []byte
  169. // - blob []byte
  170. // - itemType uint16
  171. func (_e *mockBARTAssetManager_Expecter) InsertBARTItem(ctx any, hash any, blob any, itemType any) *mockBARTAssetManager_InsertBARTItem_Call {
  172. return &mockBARTAssetManager_InsertBARTItem_Call{Call: _e.mock.On("InsertBARTItem", ctx, hash, blob, itemType)}
  173. }
  174. func (_c *mockBARTAssetManager_InsertBARTItem_Call) Run(run func(ctx context.Context, hash []byte, blob []byte, itemType uint16)) *mockBARTAssetManager_InsertBARTItem_Call {
  175. _c.Call.Run(func(args mock.Arguments) {
  176. var arg0 context.Context
  177. if args[0] != nil {
  178. arg0 = args[0].(context.Context)
  179. }
  180. var arg1 []byte
  181. if args[1] != nil {
  182. arg1 = args[1].([]byte)
  183. }
  184. var arg2 []byte
  185. if args[2] != nil {
  186. arg2 = args[2].([]byte)
  187. }
  188. var arg3 uint16
  189. if args[3] != nil {
  190. arg3 = args[3].(uint16)
  191. }
  192. run(
  193. arg0,
  194. arg1,
  195. arg2,
  196. arg3,
  197. )
  198. })
  199. return _c
  200. }
  201. func (_c *mockBARTAssetManager_InsertBARTItem_Call) Return(err error) *mockBARTAssetManager_InsertBARTItem_Call {
  202. _c.Call.Return(err)
  203. return _c
  204. }
  205. func (_c *mockBARTAssetManager_InsertBARTItem_Call) RunAndReturn(run func(ctx context.Context, hash []byte, blob []byte, itemType uint16) error) *mockBARTAssetManager_InsertBARTItem_Call {
  206. _c.Call.Return(run)
  207. return _c
  208. }
  209. // ListBARTItems provides a mock function for the type mockBARTAssetManager
  210. func (_mock *mockBARTAssetManager) ListBARTItems(ctx context.Context, itemType uint16) ([]state.BARTItem, error) {
  211. ret := _mock.Called(ctx, itemType)
  212. if len(ret) == 0 {
  213. panic("no return value specified for ListBARTItems")
  214. }
  215. var r0 []state.BARTItem
  216. var r1 error
  217. if returnFunc, ok := ret.Get(0).(func(context.Context, uint16) ([]state.BARTItem, error)); ok {
  218. return returnFunc(ctx, itemType)
  219. }
  220. if returnFunc, ok := ret.Get(0).(func(context.Context, uint16) []state.BARTItem); ok {
  221. r0 = returnFunc(ctx, itemType)
  222. } else {
  223. if ret.Get(0) != nil {
  224. r0 = ret.Get(0).([]state.BARTItem)
  225. }
  226. }
  227. if returnFunc, ok := ret.Get(1).(func(context.Context, uint16) error); ok {
  228. r1 = returnFunc(ctx, itemType)
  229. } else {
  230. r1 = ret.Error(1)
  231. }
  232. return r0, r1
  233. }
  234. // mockBARTAssetManager_ListBARTItems_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListBARTItems'
  235. type mockBARTAssetManager_ListBARTItems_Call struct {
  236. *mock.Call
  237. }
  238. // ListBARTItems is a helper method to define mock.On call
  239. // - ctx context.Context
  240. // - itemType uint16
  241. func (_e *mockBARTAssetManager_Expecter) ListBARTItems(ctx any, itemType any) *mockBARTAssetManager_ListBARTItems_Call {
  242. return &mockBARTAssetManager_ListBARTItems_Call{Call: _e.mock.On("ListBARTItems", ctx, itemType)}
  243. }
  244. func (_c *mockBARTAssetManager_ListBARTItems_Call) Run(run func(ctx context.Context, itemType uint16)) *mockBARTAssetManager_ListBARTItems_Call {
  245. _c.Call.Run(func(args mock.Arguments) {
  246. var arg0 context.Context
  247. if args[0] != nil {
  248. arg0 = args[0].(context.Context)
  249. }
  250. var arg1 uint16
  251. if args[1] != nil {
  252. arg1 = args[1].(uint16)
  253. }
  254. run(
  255. arg0,
  256. arg1,
  257. )
  258. })
  259. return _c
  260. }
  261. func (_c *mockBARTAssetManager_ListBARTItems_Call) Return(bARTItems []state.BARTItem, err error) *mockBARTAssetManager_ListBARTItems_Call {
  262. _c.Call.Return(bARTItems, err)
  263. return _c
  264. }
  265. func (_c *mockBARTAssetManager_ListBARTItems_Call) RunAndReturn(run func(ctx context.Context, itemType uint16) ([]state.BARTItem, error)) *mockBARTAssetManager_ListBARTItems_Call {
  266. _c.Call.Return(run)
  267. return _c
  268. }