github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/cdc/redo/writer/file/mock_fileWriter.go (about) 1 // Code generated by mockery v2.14.1. DO NOT EDIT. 2 3 package file 4 5 import mock "github.com/stretchr/testify/mock" 6 7 // mockFileWriter is an autogenerated mock type for the fileWriter type 8 type mockFileWriter struct { 9 mock.Mock 10 } 11 12 // AdvanceTs provides a mock function with given fields: commitTs 13 func (_m *mockFileWriter) AdvanceTs(commitTs uint64) { 14 _m.Called(commitTs) 15 } 16 17 // Close provides a mock function with given fields: 18 func (_m *mockFileWriter) Close() error { 19 ret := _m.Called() 20 21 var r0 error 22 if rf, ok := ret.Get(0).(func() error); ok { 23 r0 = rf() 24 } else { 25 r0 = ret.Error(0) 26 } 27 28 return r0 29 } 30 31 // Flush provides a mock function with given fields: 32 func (_m *mockFileWriter) Flush() error { 33 ret := _m.Called() 34 35 var r0 error 36 if rf, ok := ret.Get(0).(func() error); ok { 37 r0 = rf() 38 } else { 39 r0 = ret.Error(0) 40 } 41 42 return r0 43 } 44 45 // IsRunning provides a mock function with given fields: 46 func (_m *mockFileWriter) IsRunning() bool { 47 ret := _m.Called() 48 49 var r0 bool 50 if rf, ok := ret.Get(0).(func() bool); ok { 51 r0 = rf() 52 } else { 53 r0 = ret.Get(0).(bool) 54 } 55 56 return r0 57 } 58 59 // Write provides a mock function with given fields: p 60 func (_m *mockFileWriter) Write(p []byte) (int, error) { 61 ret := _m.Called(p) 62 63 var r0 int 64 if rf, ok := ret.Get(0).(func([]byte) int); ok { 65 r0 = rf(p) 66 } else { 67 r0 = ret.Get(0).(int) 68 } 69 70 var r1 error 71 if rf, ok := ret.Get(1).(func([]byte) error); ok { 72 r1 = rf(p) 73 } else { 74 r1 = ret.Error(1) 75 } 76 77 return r0, r1 78 } 79 80 type mockConstructorTestingTnewMockFileWriter interface { 81 mock.TestingT 82 Cleanup(func()) 83 } 84 85 // newMockFileWriter creates a new instance of mockFileWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 86 func newMockFileWriter(t mockConstructorTestingTnewMockFileWriter) *mockFileWriter { 87 mock := &mockFileWriter{} 88 mock.Mock.Test(t) 89 90 t.Cleanup(func() { mock.AssertExpectations(t) }) 91 92 return mock 93 }