File tree Expand file tree Collapse file tree 2 files changed +49
-1
lines changed
cli/src/test/java/com/scalar/db/dataloader/cli/command/dataimport
core/src/main/java/com/scalar/db/dataloader/core/dataimport Expand file tree Collapse file tree 2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 11package com .scalar .db .dataloader .cli .command .dataimport ;
22
33import static org .junit .jupiter .api .Assertions .assertEquals ;
4+ import static org .junit .jupiter .api .Assertions .assertFalse ;
45import static org .junit .jupiter .api .Assertions .assertThrows ;
56import static org .junit .jupiter .api .Assertions .assertTrue ;
67
@@ -279,4 +280,51 @@ void call_withoutMaxThreads_shouldDefaultToAvailableProcessors() {
279280 // Verify it was set to available processors
280281 assertEquals (Runtime .getRuntime ().availableProcessors (), command .maxThreads );
281282 }
283+
284+ @ Test
285+ void call_withoutSpecifyingLogRawRecord_shouldUseDefaultTrueValue () {
286+ // Simulate command line parsing with --max-threads
287+ String [] args = {
288+ "--config" ,
289+ "scalardb.properties" ,
290+ "--file" ,
291+ "import.json" ,
292+ "--namespace" ,
293+ "scalar" ,
294+ "--table" ,
295+ "asset" ,
296+ "--max-threads" ,
297+ "8"
298+ };
299+ ImportCommand command = new ImportCommand ();
300+ CommandLine cmd = new CommandLine (command );
301+ cmd .parseArgs (args );
302+
303+ // Verify the value was parsed
304+ assertTrue (command .logRawRecord );
305+ }
306+
307+ @ Test
308+ void call_withSpecifyingLogRawRecordFalse_shouldUseFalsee () {
309+ // Simulate command line parsing with --max-threads
310+ String [] args = {
311+ "--config" ,
312+ "scalardb.properties" ,
313+ "--file" ,
314+ "import.json" ,
315+ "--namespace" ,
316+ "scalar" ,
317+ "--table" ,
318+ "asset" ,
319+ "--max-threads" ,
320+ "8" ,
321+ "--log-raw-record=false"
322+ };
323+ ImportCommand command = new ImportCommand ();
324+ CommandLine cmd = new CommandLine (command );
325+ cmd .parseArgs (args );
326+
327+ // Verify the value was parsed
328+ assertFalse (command .logRawRecord );
329+ }
282330}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public class ImportOptions {
2727 @ Builder .Default private final char delimiter = ',' ;
2828
2929 @ Builder .Default private final boolean logSuccessRecords = false ;
30- @ Builder .Default private final boolean logRawRecord = false ;
30+ @ Builder .Default private final boolean logRawRecord = true ;
3131
3232 private final int dataChunkSize ;
3333 private final int transactionBatchSize ;
You can’t perform that action at this time.
0 commit comments