@@ -227,46 +227,52 @@ describe('getBatchEventProcessor', () => {
227
227
} ) ;
228
228
229
229
230
- it ( 'uses a IntervalRepeater with default flush interval and adds a startup log if flushInterval is not provided' , ( ) => {
230
+ it ( 'uses default batch size and adds a startup log if flushInterval is not provided' , ( ) => {
231
231
const options = {
232
232
eventDispatcher : getMockEventDispatcher ( ) ,
233
+ defaultBatchSize : 77 ,
234
+ defaultFlushInterval : 12345 ,
233
235
} ;
234
236
235
237
const processor = getBatchEventProcessor ( options ) ;
236
238
237
239
expect ( Object . is ( processor , MockBatchEventProcessor . mock . instances [ 0 ] ) ) . toBe ( true ) ;
238
- expect ( MockBatchEventProcessor . mock . calls [ 0 ] [ 0 ] . batchSize ) . toBe ( DEFAULT_EVENT_BATCH_SIZE ) ;
240
+ expect ( MockBatchEventProcessor . mock . calls [ 0 ] [ 0 ] . batchSize ) . toBe ( 77 ) ;
239
241
240
242
const startupLogs = MockBatchEventProcessor . mock . calls [ 0 ] [ 0 ] . startupLogs ;
241
243
expect ( startupLogs ) . toEqual ( expect . arrayContaining ( [ {
242
244
level : LogLevel . Warn ,
243
245
message : 'Invalid batchSize %s, defaulting to %s' ,
244
- params : [ undefined , DEFAULT_EVENT_BATCH_SIZE ] ,
246
+ params : [ undefined , 77 ] ,
245
247
} ] ) ) ;
246
248
} ) ;
247
249
248
250
it ( 'uses default size and adds a startup log if provided batchSize is less than 1' , ( ) => {
249
251
const options = {
250
252
eventDispatcher : getMockEventDispatcher ( ) ,
251
253
batchSize : - 1 ,
254
+ defaultBatchSize : 77 ,
255
+ defaultFlushInterval : 12345 ,
252
256
} ;
253
257
254
258
const processor = getBatchEventProcessor ( options ) ;
255
259
256
260
expect ( Object . is ( processor , MockBatchEventProcessor . mock . instances [ 0 ] ) ) . toBe ( true ) ;
257
- expect ( MockBatchEventProcessor . mock . calls [ 0 ] [ 0 ] . batchSize ) . toBe ( DEFAULT_EVENT_BATCH_SIZE ) ;
261
+ expect ( MockBatchEventProcessor . mock . calls [ 0 ] [ 0 ] . batchSize ) . toBe ( 77 ) ;
258
262
259
263
const startupLogs = MockBatchEventProcessor . mock . calls [ 0 ] [ 0 ] . startupLogs ;
260
264
expect ( startupLogs ) . toEqual ( expect . arrayContaining ( [ {
261
265
level : LogLevel . Warn ,
262
266
message : 'Invalid batchSize %s, defaulting to %s' ,
263
- params : [ - 1 , DEFAULT_EVENT_BATCH_SIZE ] ,
267
+ params : [ - 1 , 77 ] ,
264
268
} ] ) ) ;
265
269
} ) ;
266
270
267
271
it ( 'does not use a failedEventRepeater if failedEventRetryInterval is not provided' , ( ) => {
268
272
const options = {
269
273
eventDispatcher : getMockEventDispatcher ( ) ,
274
+ defaultBatchSize : 77 ,
275
+ defaultFlushInterval : 12345 ,
270
276
} ;
271
277
272
278
const processor = getBatchEventProcessor ( options ) ;
@@ -279,6 +285,8 @@ describe('getBatchEventProcessor', () => {
279
285
const options = {
280
286
eventDispatcher : getMockEventDispatcher ( ) ,
281
287
failedEventRetryInterval : 12345 ,
288
+ defaultBatchSize : 77 ,
289
+ defaultFlushInterval : 12345 ,
282
290
} ;
283
291
284
292
const processor = getBatchEventProcessor ( options ) ;
@@ -292,6 +300,8 @@ describe('getBatchEventProcessor', () => {
292
300
const eventDispatcher = getMockEventDispatcher ( ) ;
293
301
const options = {
294
302
eventDispatcher,
303
+ defaultBatchSize : 77 ,
304
+ defaultFlushInterval : 12345 ,
295
305
} ;
296
306
297
307
const processor = getBatchEventProcessor ( options ) ;
@@ -303,6 +313,8 @@ describe('getBatchEventProcessor', () => {
303
313
it ( 'does not use any closingEventDispatcher if not provided' , ( ) => {
304
314
const options = {
305
315
eventDispatcher : getMockEventDispatcher ( ) ,
316
+ defaultBatchSize : 77 ,
317
+ defaultFlushInterval : 12345 ,
306
318
} ;
307
319
308
320
const processor = getBatchEventProcessor ( options ) ;
@@ -316,6 +328,8 @@ describe('getBatchEventProcessor', () => {
316
328
const options = {
317
329
eventDispatcher : getMockEventDispatcher ( ) ,
318
330
closingEventDispatcher,
331
+ defaultBatchSize : 77 ,
332
+ defaultFlushInterval : 12345 ,
319
333
} ;
320
334
321
335
const processor = getBatchEventProcessor ( options ) ;
@@ -329,6 +343,8 @@ describe('getBatchEventProcessor', () => {
329
343
const options = {
330
344
eventDispatcher : getMockEventDispatcher ( ) ,
331
345
eventStore,
346
+ defaultBatchSize : 77 ,
347
+ defaultFlushInterval : 12345 ,
332
348
} ;
333
349
334
350
const processor = getBatchEventProcessor ( options ) ;
0 commit comments