1919import java .lang .reflect .Method ;
2020import java .util .ArrayList ;
2121import java .util .HashMap ;
22- import java .util .Scanner ;
2322
2423import static org .junit .Assert .*;
2524
@@ -249,7 +248,7 @@ public void testBatchSizeExceedsMax() throws Exception {
249248 // Ignore, Testing concurrency/batch config
250249 }
251250
252- assertEquals (1000 , getPrivateInt (controller , "insertBatchSize" ));
251+ assertEquals (Constants . MAX_INSERT_BATCH_SIZE . intValue () , getPrivateInt (controller , "insertBatchSize" ));
253252 }
254253
255254 @ Test
@@ -265,7 +264,7 @@ public void testConcurrencyExceedsMax() throws Exception {
265264 // Ignore, Testing concurrency/batch config
266265 }
267266
268- assertEquals (1 , getPrivateInt (controller , "insertConcurrencyLimit" ));
267+ assertEquals (Constants . INSERT_CONCURRENCY_LIMIT . intValue () , getPrivateInt (controller , "insertConcurrencyLimit" ));
269268 }
270269
271270 @ Test
@@ -280,7 +279,7 @@ public void testBatchSizeZeroOrNegative() throws Exception {
280279 // Ignore, Testing concurrency/batch config
281280 }
282281
283- assertEquals (50 , getPrivateInt (controller , "insertBatchSize" ));
282+ assertEquals (Constants . INSERT_BATCH_SIZE . intValue () , getPrivateInt (controller , "insertBatchSize" ));
284283
285284 writeEnv ("INSERT_BATCH_SIZE=-5" );
286285
@@ -290,7 +289,7 @@ public void testBatchSizeZeroOrNegative() throws Exception {
290289 // Ignore, Testing concurrency/batch config
291290 }
292291
293- assertEquals (50 , getPrivateInt (controller , "insertBatchSize" ));
292+ assertEquals (Constants . INSERT_BATCH_SIZE . intValue () , getPrivateInt (controller , "insertBatchSize" ));
294293 }
295294
296295 @ Test
@@ -369,7 +368,7 @@ public void testHighConcurrencyForLowRecords() throws Exception {
369368
370369 // Only 10 batches needed, so concurrency should be clamped to 10
371370 assertEquals (1000 , getPrivateInt (controller , "insertBatchSize" ));
372- assertEquals (10 , getPrivateInt (controller , "insertConcurrencyLimit" ));
371+ assertEquals (Constants . MAX_INSERT_CONCURRENCY_LIMIT . intValue () , getPrivateInt (controller , "insertConcurrencyLimit" ));
373372 }
374373
375374
@@ -386,7 +385,7 @@ public void testFractionalLastBatch() throws Exception {
386385
387386 // Last batch should have 50 records, concurrency should be 101
388387 assertEquals (100 , getPrivateInt (controller , "insertBatchSize" ));
389- assertEquals (10 , getPrivateInt (controller , "insertConcurrencyLimit" ));
388+ assertEquals (Constants . INSERT_CONCURRENCY_LIMIT . intValue () , getPrivateInt (controller , "insertConcurrencyLimit" ));
390389 }
391390
392391 private int getPrivateInt (Object obj , String field ) throws Exception {
0 commit comments