mock_bart_asset_manager_test.go 8.9 KB

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