@Test public void testInjectionOfString() throws CLIException { HelloClI command = new HelloClI(); CLI cli = CLIConfigurator.define(HelloClI.class); CommandLine evaluatedCLI = cli.parse(Arrays.asList("--name", "vert.x")); CLIConfigurator.inject(evaluatedCLI, command); assertThat(command.run()).isEqualToIgnoringCase("Hello vert.x"); assertThat(command.name).isEqualToIgnoringCase("vert.x"); }
private CommandLine parse(CLI cli, String... args) throws CLIException { return cli.parse(Arrays.asList(args)); }