use of picocli.CommandLine.RunLast in project besu by hyperledger.
the class CommandLineUtilsTest method multipleMainOptions.
@Test
public void multipleMainOptions() {
final AbstractTestCommand testCommand = new TestMultiCommandWithDeps(mockLogger);
testCommand.commandLine.parseWithHandlers(new RunLast(), defaultExceptionHandler(), "--option-enabled", "false", "--other-option-enabled", "false", "--option2", "20");
verifyMultiOptionsConstraintLoggerCall(mockLogger, "--option2 and/or --option3 ignored because none of --option-enabled or --other-option-enabled was defined.");
assertThat(testCommand.optionEnabled).isFalse();
assertThat(testCommand.otherOptionEnabled).isFalse();
assertThat(testCommand.option2).isEqualTo(20);
}
use of picocli.CommandLine.RunLast in project besu by hyperledger.
the class CommandLineUtilsTest method optionsAreExpected.
@Test
public void optionsAreExpected() {
final AbstractTestCommand testCommand = new TestCommandWithDeps(mockLogger);
testCommand.commandLine.parseWithHandlers(new RunLast(), defaultExceptionHandler(), "--option2", "20", "--option3", "30", "--option4", "40");
verifyNoMoreInteractions(mockLogger);
assertThat(testCommand.optionEnabled).isTrue();
assertThat(testCommand.option2).isEqualTo(20);
assertThat(testCommand.option3).isEqualTo(30);
assertThat(testCommand.option4).isEqualTo(40);
}
use of picocli.CommandLine.RunLast in project besu by hyperledger.
the class CommandLineUtilsTest method noDependencies.
@Test
public void noDependencies() {
final AbstractTestCommand testCommand = new TestCommandWithoutDeps(mockLogger);
testCommand.commandLine.parseWithHandlers(new RunLast(), defaultExceptionHandler(), "--option-enabled", "false", "--option2", "20", "--option3", "30", "--option4", "40");
verifyNoMoreInteractions(mockLogger);
assertThat(testCommand.optionEnabled).isFalse();
assertThat(testCommand.option2).isEqualTo(20);
assertThat(testCommand.option3).isEqualTo(30);
assertThat(testCommand.option4).isEqualTo(40);
}
Aggregations