In a unit test for a utility using picocli, I would like to assert that picocli assigned the correct value to the option. How can I get the value associated with an option in a unit test?
Here is the current version of the unit test:
@Test
void callWithOptionForSuffix() {
NextMajorSubcommand command = new NextMajorSubcommand();
CommandLine cmdline = new CommandLine(command);
ParseResult parseResult = cmdline.parseArgs("--suffix", "DELTA", "4.5.6");
assertThat(parseResult.hasMatchedPositional(0)).isTrue();
assertThat(parseResult.matchedOptions()).isNotEmpty();
assertThat(parseResult.matchedOption("--suffix").isOption());
}