github.com/datastax/go-cassandra-native-protocol@v0.0.0-20220706104457-5e8aad05cf90/datacodec/mock_codec_test.go (about) 1 // Code generated by mockery v2.12.3. DO NOT EDIT. 2 3 package datacodec 4 5 import ( 6 mock "github.com/stretchr/testify/mock" 7 8 datatype "github.com/datastax/go-cassandra-native-protocol/datatype" 9 10 primitive "github.com/datastax/go-cassandra-native-protocol/primitive" 11 ) 12 13 // mockCodec is an autogenerated mock type for the Codec type 14 type mockCodec struct { 15 mock.Mock 16 } 17 18 // DataType provides a mock function with given fields: 19 func (_m *mockCodec) DataType() datatype.DataType { 20 ret := _m.Called() 21 22 var r0 datatype.DataType 23 if rf, ok := ret.Get(0).(func() datatype.DataType); ok { 24 r0 = rf() 25 } else { 26 if ret.Get(0) != nil { 27 r0 = ret.Get(0).(datatype.DataType) 28 } 29 } 30 31 return r0 32 } 33 34 // Decode provides a mock function with given fields: source, dest, version 35 func (_m *mockCodec) Decode(source []byte, dest interface{}, version primitive.ProtocolVersion) (bool, error) { 36 ret := _m.Called(source, dest, version) 37 38 var r0 bool 39 if rf, ok := ret.Get(0).(func([]byte, interface{}, primitive.ProtocolVersion) bool); ok { 40 r0 = rf(source, dest, version) 41 } else { 42 r0 = ret.Get(0).(bool) 43 } 44 45 var r1 error 46 if rf, ok := ret.Get(1).(func([]byte, interface{}, primitive.ProtocolVersion) error); ok { 47 r1 = rf(source, dest, version) 48 } else { 49 r1 = ret.Error(1) 50 } 51 52 return r0, r1 53 } 54 55 // Encode provides a mock function with given fields: source, version 56 func (_m *mockCodec) Encode(source interface{}, version primitive.ProtocolVersion) ([]byte, error) { 57 ret := _m.Called(source, version) 58 59 var r0 []byte 60 if rf, ok := ret.Get(0).(func(interface{}, primitive.ProtocolVersion) []byte); ok { 61 r0 = rf(source, version) 62 } else { 63 if ret.Get(0) != nil { 64 r0 = ret.Get(0).([]byte) 65 } 66 } 67 68 var r1 error 69 if rf, ok := ret.Get(1).(func(interface{}, primitive.ProtocolVersion) error); ok { 70 r1 = rf(source, version) 71 } else { 72 r1 = ret.Error(1) 73 } 74 75 return r0, r1 76 } 77 78 type newMockCodecT interface { 79 mock.TestingT 80 Cleanup(func()) 81 } 82 83 // newMockCodec creates a new instance of mockCodec. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 84 func newMockCodec(t newMockCodecT) *mockCodec { 85 mock := &mockCodec{} 86 mock.Mock.Test(t) 87 88 t.Cleanup(func() { mock.AssertExpectations(t) }) 89 90 return mock 91 }