File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
data-loader/cli/src/test/java/com/scalar/db/dataloader/cli/command/dataimport Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -199,4 +199,34 @@ void call_withOnlyDeprecatedLogSuccess_shouldApplyValue() throws Exception {
199199 // Verify the value was applied to enable-log-success
200200 assertTrue (command .enableLogSuccessRecords );
201201 }
202+
203+ @ Test
204+ void call_withEnableLogSuccess_shouldSetToTrueWithoutValue () throws Exception {
205+ Path importFile = tempDir .resolve ("import.json" );
206+ Files .createFile (importFile );
207+
208+ // Simulate command line parsing with the new flag without providing true/false value
209+ String [] args = {"--file" , importFile .toString (), "--enable-log-success" };
210+ ImportCommand command = new ImportCommand ();
211+ CommandLine cmd = new CommandLine (command );
212+ cmd .parseArgs (args );
213+
214+ // Verify the flag was parsed correctly without requiring a value
215+ assertTrue (command .enableLogSuccessRecords );
216+ }
217+
218+ @ Test
219+ void call_withEnableLogSuccessShortForm_shouldSetToTrueWithoutValue () throws Exception {
220+ Path importFile = tempDir .resolve ("import.json" );
221+ Files .createFile (importFile );
222+
223+ // Simulate command line parsing with the short form flag without providing true/false value
224+ String [] args = {"--file" , importFile .toString (), "-ls" };
225+ ImportCommand command = new ImportCommand ();
226+ CommandLine cmd = new CommandLine (command );
227+ cmd .parseArgs (args );
228+
229+ // Verify the short form flag was parsed correctly without requiring a value
230+ assertTrue (command .enableLogSuccessRecords );
231+ }
202232}
You can’t perform that action at this time.
0 commit comments