github.com/koko1123/flow-go-1@v0.29.6/storage/mock/batch_storage.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 badger "github.com/dgraph-io/badger/v3" 7 mock "github.com/stretchr/testify/mock" 8 ) 9 10 // BatchStorage is an autogenerated mock type for the BatchStorage type 11 type BatchStorage struct { 12 mock.Mock 13 } 14 15 // Flush provides a mock function with given fields: 16 func (_m *BatchStorage) Flush() error { 17 ret := _m.Called() 18 19 var r0 error 20 if rf, ok := ret.Get(0).(func() error); ok { 21 r0 = rf() 22 } else { 23 r0 = ret.Error(0) 24 } 25 26 return r0 27 } 28 29 // GetWriter provides a mock function with given fields: 30 func (_m *BatchStorage) GetWriter() *badger.WriteBatch { 31 ret := _m.Called() 32 33 var r0 *badger.WriteBatch 34 if rf, ok := ret.Get(0).(func() *badger.WriteBatch); ok { 35 r0 = rf() 36 } else { 37 if ret.Get(0) != nil { 38 r0 = ret.Get(0).(*badger.WriteBatch) 39 } 40 } 41 42 return r0 43 } 44 45 // OnSucceed provides a mock function with given fields: callback 46 func (_m *BatchStorage) OnSucceed(callback func()) { 47 _m.Called(callback) 48 } 49 50 type mockConstructorTestingTNewBatchStorage interface { 51 mock.TestingT 52 Cleanup(func()) 53 } 54 55 // NewBatchStorage creates a new instance of BatchStorage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 56 func NewBatchStorage(t mockConstructorTestingTNewBatchStorage) *BatchStorage { 57 mock := &BatchStorage{} 58 mock.Mock.Test(t) 59 60 t.Cleanup(func() { mock.AssertExpectations(t) }) 61 62 return mock 63 }