|
187 | 187 | it 'creates produce checkpoint with correct tags' do |
188 | 188 | carrier_set = double('carrier_set') |
189 | 189 | expect(carrier_set).to receive(:call).with('dd-pathway-ctx-base64', anything) |
190 | | - |
| 190 | + |
191 | 191 | result = processor.set_produce_checkpoint('kafka', 'orders-topic') { |key, value| carrier_set.call(key, value) } |
192 | | - |
| 192 | + |
193 | 193 | expect(result).to be_a(String) |
194 | 194 | expect(result).not_to be_empty |
195 | 195 | end |
196 | 196 |
|
197 | 197 | it 'works without block' do |
198 | 198 | result = processor.set_produce_checkpoint('kafka', 'orders-topic') |
199 | | - |
| 199 | + |
200 | 200 | expect(result).to be_a(String) |
201 | 201 | expect(result).not_to be_empty |
202 | 202 | end |
203 | 203 |
|
204 | 204 | it 'returns nil when processor disabled' do |
205 | 205 | processor.enabled = false |
206 | | - |
| 206 | + |
207 | 207 | result = processor.set_produce_checkpoint('kafka', 'orders-topic') |
208 | | - |
| 208 | + |
209 | 209 | expect(result).to be_nil |
210 | 210 | end |
211 | 211 | end |
|
214 | 214 | it 'creates consume checkpoint with correct tags' do |
215 | 215 | carrier_get = double('carrier_get') |
216 | 216 | expect(carrier_get).to receive(:call).with('dd-pathway-ctx-base64').and_return(nil) |
217 | | - |
| 217 | + |
218 | 218 | result = processor.set_consume_checkpoint('kafka', 'orders-topic') { |key| carrier_get.call(key) } |
219 | | - |
| 219 | + |
220 | 220 | expect(result).to be_a(String) |
221 | 221 | expect(result).not_to be_empty |
222 | 222 | end |
|
226 | 226 | carrier_get = double('carrier_get') |
227 | 227 | expect(carrier_get).to receive(:call).with('dd-pathway-ctx-base64').and_return(encoded_context) |
228 | 228 | expect(processor).to receive(:decode_pathway_b64).with(encoded_context) |
229 | | - |
| 229 | + |
230 | 230 | processor.set_consume_checkpoint('kafka', 'orders-topic') { |key| carrier_get.call(key) } |
231 | 231 | end |
232 | 232 |
|
233 | 233 | it 'works without block' do |
234 | 234 | result = processor.set_consume_checkpoint('kafka', 'orders-topic') |
235 | | - |
| 235 | + |
236 | 236 | expect(result).to be_a(String) |
237 | 237 | expect(result).not_to be_empty |
238 | 238 | end |
239 | 239 |
|
240 | 240 | it 'respects manual_checkpoint parameter' do |
241 | 241 | result = processor.set_consume_checkpoint('kafka', 'orders-topic', manual_checkpoint: false) |
242 | | - |
| 242 | + |
243 | 243 | expect(result).to be_a(String) |
244 | 244 | expect(result).not_to be_empty |
245 | 245 | end |
246 | 246 |
|
247 | 247 | it 'returns nil when processor disabled' do |
248 | 248 | processor.enabled = false |
249 | | - |
| 249 | + |
250 | 250 | result = processor.set_consume_checkpoint('kafka', 'orders-topic') |
251 | | - |
| 251 | + |
252 | 252 | expect(result).to be_nil |
253 | 253 | end |
254 | 254 | end |
|
0 commit comments