@@ -20,7 +20,8 @@ import (
2020
2121var (
2222 // Message key and value for JSON
23- key = []byte ("test-key" )
23+ Jsonkey = []byte ("json-key" )
24+ Avrokey = []byte ("avro-key" )
2425 value = []byte (`{"int_value": 100,"float_value": 99.99,"boolean_true": true,"boolean_false": false,"timestamp_value": "2026-03-22T14:30:00Z","string_value": "test_string"}` )
2526 evolved_value = []byte (`{"int_value": 100,"float_value": 99.99,"boolean_true": true,"boolean_false": false,"timestamp_value": "2026-03-22T14:30:00Z","string_value": "test_string", "id_int": 101}` )
2627 filtervalue1 = []byte (`{"int_value": 99,"float_value": 99.99}` )
@@ -128,23 +129,23 @@ func ExecuteQueryForJson(ctx context.Context, t *testing.T, streams []string, op
128129 case "add" :
129130 for partition := 0 ; partition < partitionCount ; partition ++ {
130131 writeMessagesWithRetry (ctx , t , writer , kafka.Message {
131- Key : key ,
132+ Key : Jsonkey ,
132133 Value : value ,
133134 })
134135 }
135136 writeMessagesWithRetry (ctx , t , writer , kafka.Message {
136- Key : key ,
137+ Key : Jsonkey ,
137138 Value : filtervalue1 ,
138139 })
139140 writeMessagesWithRetry (ctx , t , writer , kafka.Message {
140- Key : key ,
141+ Key : Jsonkey ,
141142 Value : filtervalue2 ,
142143 })
143144 t .Logf ("Added 7 messages to topic '%s' (one per partition and two for filters)" , streams [0 ])
144145 case "evolve-schema" :
145146 for partition := 0 ; partition < partitionCount ; partition ++ {
146147 writeMessagesWithRetry (ctx , t , writer , kafka.Message {
147- Key : key ,
148+ Key : Jsonkey ,
148149 Value : evolved_value ,
149150 Partition : partition ,
150151 })
@@ -203,8 +204,8 @@ func ExecuteQueryForAvro(ctx context.Context, t *testing.T, streams []string, op
203204 confluentBaseMsg := encodeConfluentBinary (schemaID , binaryData )
204205 confluentFilterMsg := encodeConfluentBinary (schemaID , binaryDataFilter )
205206 err = writer .WriteMessages (ctx ,
206- kafka.Message {Topic : streams [ 0 ], Key : [] byte ( "avro-key" ) , Value : confluentBaseMsg },
207- kafka.Message {Topic : streams [ 0 ], Key : [] byte ( "avro-key" ) , Value : confluentFilterMsg },
207+ kafka.Message {Key : Avrokey , Value : confluentBaseMsg },
208+ kafka.Message {Key : Avrokey , Value : confluentFilterMsg },
208209 )
209210 require .NoError (t , err )
210211 case "evolve-schema" :
@@ -216,8 +217,7 @@ func ExecuteQueryForAvro(ctx context.Context, t *testing.T, streams []string, op
216217 require .NoError (t , err )
217218 confluentMsg := encodeConfluentBinary (schemaID , binaryData )
218219 err = writer .WriteMessages (ctx , kafka.Message {
219- Topic : streams [0 ],
220- Key : []byte ("avro-key" ),
220+ Key : Avrokey ,
221221 Value : confluentMsg ,
222222 })
223223 require .NoError (t , err )
0 commit comments