@@ -16,7 +16,8 @@ func TestPartition(t *testing.T) {
1616 p := newPartition (
1717 0 ,
1818 map [int ]* Broker {1 : {Id : 1 }},
19- func (record * kafka.Record , partition int , traits events.Traits ) {}, func (record * kafka.Record ) {}, & Topic {})
19+ func (key , payload interface {}, headers []kafka.RecordHeader , partition int , offset int64 , traits events.Traits ) {
20+ }, func (record * kafka.Record ) {}, & Topic {})
2021
2122 require .Equal (t , 0 , p .Index )
2223 require .Equal (t , int64 (0 ), p .StartOffset ())
@@ -26,12 +27,12 @@ func TestPartition(t *testing.T) {
2627}
2728
2829func TestPartition_Write (t * testing.T ) {
29- var log []* kafka. Record
30+ var log []int64
3031 p := newPartition (
3132 0 ,
3233 map [int ]* Broker {1 : {Id : 1 }},
33- func (record * kafka.Record , partition int , traits events.Traits ) {
34- log = append (log , record )
34+ func (key , payload interface {}, headers [] kafka.RecordHeader , partition int , offset int64 , traits events.Traits ) {
35+ log = append (log , offset )
3536 }, func (record * kafka.Record ) {}, & Topic {})
3637
3738 offset , records , err := p .Write (kafka.RecordBatch {
@@ -74,7 +75,8 @@ func TestPartition_Read_Empty(t *testing.T) {
7475 p := newPartition (
7576 0 ,
7677 map [int ]* Broker {1 : {Id : 1 }},
77- func (_ * kafka.Record , partition int , _ events.Traits ) {}, func (record * kafka.Record ) {}, & Topic {})
78+ func (key , payload interface {}, headers []kafka.RecordHeader , partition int , offset int64 , _ events.Traits ) {
79+ }, func (record * kafka.Record ) {}, & Topic {})
7880 b , errCode := p .Read (0 , 1 )
7981 require .Equal (t , kafka .None , errCode )
8082 require .Equal (t , 0 , len (b .Records ))
@@ -84,7 +86,8 @@ func TestPartition_Read(t *testing.T) {
8486 p := newPartition (
8587 0 ,
8688 map [int ]* Broker {1 : {Id : 1 }},
87- func (_ * kafka.Record , partition int , _ events.Traits ) {}, func (record * kafka.Record ) {}, & Topic {})
89+ func (key , payload interface {}, headers []kafka.RecordHeader , partition int , offset int64 , _ events.Traits ) {
90+ }, func (record * kafka.Record ) {}, & Topic {})
8891 offset , records , err := p .Write (kafka.RecordBatch {
8992 Records : []* kafka.Record {
9093 {
@@ -108,7 +111,8 @@ func TestPartition_Read_OutOfOffset_Empty(t *testing.T) {
108111 p := newPartition (
109112 0 ,
110113 map [int ]* Broker {1 : {Id : 1 }},
111- func (_ * kafka.Record , partition int , _ events.Traits ) {}, func (record * kafka.Record ) {}, & Topic {})
114+ func (key , payload interface {}, headers []kafka.RecordHeader , partition int , offset int64 , _ events.Traits ) {
115+ }, func (record * kafka.Record ) {}, & Topic {})
112116 b , errCode := p .Read (10 , 1 )
113117 require .Equal (t , kafka .None , errCode )
114118 require .Equal (t , 0 , len (b .Records ))
@@ -118,7 +122,8 @@ func TestPartition_Read_OutOfOffset(t *testing.T) {
118122 p := newPartition (
119123 0 ,
120124 map [int ]* Broker {1 : {Id : 1 }},
121- func (_ * kafka.Record , partition int , _ events.Traits ) {}, func (record * kafka.Record ) {}, & Topic {})
125+ func (key , payload interface {}, headers []kafka.RecordHeader , partition int , offset int64 , _ events.Traits ) {
126+ }, func (record * kafka.Record ) {}, & Topic {})
122127 _ , _ , _ = p .Write (kafka.RecordBatch {
123128 Records : []* kafka.Record {
124129 {
@@ -139,7 +144,8 @@ func TestPartition_Write_Value_Validator(t *testing.T) {
139144 p := newPartition (
140145 0 ,
141146 map [int ]* Broker {1 : {Id : 1 }},
142- func (_ * kafka.Record , partition int , _ events.Traits ) {}, func (record * kafka.Record ) {}, & Topic {channel : & asyncapi3.Channel {Bindings : asyncapi3.ChannelBindings {
147+ func (key , payload interface {}, headers []kafka.RecordHeader , partition int , offset int64 , _ events.Traits ) {
148+ }, func (record * kafka.Record ) {}, & Topic {channel : & asyncapi3.Channel {Bindings : asyncapi3.ChannelBindings {
143149 Kafka : asyncapi3.TopicBindings {ValueSchemaValidation : true },
144150 }}})
145151 p .validator = & validator {
@@ -167,7 +173,7 @@ func TestPartition_Write_Value_Validator(t *testing.T) {
167173 require .EqualError (t , err , "validation error" )
168174 require .Len (t , recordsWithError , 1 )
169175 require .Equal (t , int32 (0 ), recordsWithError [0 ].BatchIndex )
170- require .Equal (t , "found 1 error:\n invalid type, expected string but got number\n schema path #/type" , recordsWithError [0 ].BatchIndexErrorMessage )
176+ require .Equal (t , "invalid message: found 1 error:\n invalid type, expected string but got number\n schema path #/type" , recordsWithError [0 ].BatchIndexErrorMessage )
171177 require .Equal (t , int64 (0 ), offset )
172178 require .Equal (t , int64 (0 ), p .Offset ())
173179 require .Equal (t , int64 (0 ), p .StartOffset ())
@@ -201,7 +207,8 @@ func TestPartition_Write_Value_Validator(t *testing.T) {
201207
202208func TestPatition_Retention (t * testing.T ) {
203209 p := newPartition (0 , map [int ]* Broker {1 : {Id : 1 }},
204- func (_ * kafka.Record , partition int , _ events.Traits ) {},
210+ func (key , payload interface {}, headers []kafka.RecordHeader , partition int , offset int64 , _ events.Traits ) {
211+ },
205212 func (record * kafka.Record ) {}, & Topic {})
206213 require .Equal (t , int64 (0 ), p .Head )
207214 offset , records , err := p .Write (kafka.RecordBatch {
0 commit comments