Skip to content

Commit

Permalink
Validate progress delay correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
henrya committed Jun 2, 2022
1 parent c8a10f8 commit 6ba9116
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public class ValidatorImpl {
ParameterConstants.PARAMETER_LIMIT_SHORT,
ParameterConstants.PARAMETER_LIMIT_LONG,
ParameterConstants.PARAMETER_SLEEP_LONG,
ParameterConstants.PARAMETER_SLEEP_LONG,
ParameterConstants.PARAMETER_SLEEP_LONG
ParameterConstants.PARAMETER_SLEEP_SHORT,
ParameterConstants.PARAMETER_PROGRESS_DELAY_LONG
);

MASK_VALUE = Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ void testSleepArgumentError() throws ParameterException {
.hasMessageContaining("Invalid value '-1' for option '--sleep': ");
}

@Test
@DisplayName("Test progress delay argument error")
void testProgressDelayArgumentError() throws ParameterException {
Cleaner cleaner = TestConfig.getCleaner();
cleaner.setProgressDelay(-1);
CommandLine commandLine = new CommandLine(cleaner);
cleaner.setSpec(commandLine.getCommandSpec());
assertThatThrownBy(() -> ValidatorImpl.validate(cleaner)).isInstanceOf(ParameterException.class)
.hasMessageContaining("Invalid value '-1' for option '--progress-delay': ");
}

@Test
@DisplayName("Test quiet mode")
void testQuietMode() {
Expand Down

0 comments on commit 6ba9116

Please sign in to comment.