@Test public void invalidUrlProvided() throws Exception { Path configFile = Files.createTempFile("emptyConfig", ".txt"); String[] requiredParams = {"--tomlfile", configFile.toString(), "--url", "htt: commandLine.execute(requiredParams); final String output = systemErrRule.getLog(); assertThat(output).contains("Bad server url given: unknown protocol: htt"); }
@Override public CliResult execute(String... args) throws Exception { final ConfigBuilder configBuilder = Optional.ofNullable(tomlfile) .map(fileDelegate::newInputStream) .map(stream -> this.configFactory.create(stream, null)) .orElse(ConfigBuilder.create()); final KeyDataBuilder keyDataBuilder = Optional.ofNullable(tomlfile) .map(fileDelegate::newInputStream) .map(configFactory::createKeyDataBuilder) .orElse(KeyDataBuilder.create()); ConfigBuilder adjustedConfig = applyOverrides(configBuilder, keyDataBuilder); Config config = adjustedConfig.build(); return writeToOutputFile(config, outputPath); }
LegacyCliAdapter implements CliAdapter, Callable<CliResult> { @Override public CliResult execute(String... args) throws Exception { final ConfigBuilder configBuilder = Optional.ofNullable(tomlfile) .map(fileDelegate::newInputStream) .map(stream -> this.configFactory.create(stream, null)) .orElse(ConfigBuilder.create()); final KeyDataBuilder keyDataBuilder = Optional.ofNullable(tomlfile) .map(fileDelegate::newInputStream) .map(configFactory::createKeyDataBuilder) .orElse(KeyDataBuilder.create()); ConfigBuilder adjustedConfig = applyOverrides(configBuilder, keyDataBuilder); Config config = adjustedConfig.build(); return writeToOutputFile(config, outputPath); } }
LegacyCliAdapter implements CliAdapter, Callable<CliResult> { @Override public CliResult execute(String... args) throws Exception { final ConfigBuilder configBuilder = Optional.ofNullable(tomlfile) .map(fileDelegate::newInputStream) .map(stream -> this.configFactory.create(stream, null)) .orElse(ConfigBuilder.create()); final KeyDataBuilder keyDataBuilder = Optional.ofNullable(tomlfile) .map(fileDelegate::newInputStream) .map(configFactory::createKeyDataBuilder) .orElse(KeyDataBuilder.create()); ConfigBuilder adjustedConfig = applyOverrides(configBuilder, keyDataBuilder); Config config = adjustedConfig.build(); return writeToOutputFile(config, outputPath); } LegacyCliAdapter(); }
LegacyCliAdapter implements CliAdapter, Callable<CliResult> { @Override public CliResult execute(String... args) throws Exception { final ConfigBuilder configBuilder = Optional.ofNullable(tomlfile) .map(fileDelegate::newInputStream) .map(stream -> this.configFactory.create(stream, null)) .orElse(ConfigBuilder.create()); final KeyDataBuilder keyDataBuilder = Optional.ofNullable(tomlfile) .map(fileDelegate::newInputStream) .map(configFactory::createKeyDataBuilder) .orElse(KeyDataBuilder.create()); ConfigBuilder adjustedConfig = applyOverrides(configBuilder, keyDataBuilder); Config config = adjustedConfig.build(); return writeToOutputFile(config, outputPath); } LegacyCliAdapter(); @Override CliType getType(); @Override CliResult call(); @Override CliResult execute(String... args); void setOverrides(final LegacyOverridesMixin overrides); }
LegacyCliAdapter implements CliAdapter, Callable<CliResult> { @Override public CliResult execute(String... args) throws Exception { final ConfigBuilder configBuilder = Optional.ofNullable(tomlfile) .map(fileDelegate::newInputStream) .map(stream -> this.configFactory.create(stream, null)) .orElse(ConfigBuilder.create()); final KeyDataBuilder keyDataBuilder = Optional.ofNullable(tomlfile) .map(fileDelegate::newInputStream) .map(configFactory::createKeyDataBuilder) .orElse(KeyDataBuilder.create()); ConfigBuilder adjustedConfig = applyOverrides(configBuilder, keyDataBuilder); Config config = adjustedConfig.build(); return writeToOutputFile(config, outputPath); } LegacyCliAdapter(); @Override CliType getType(); @Override CliResult call(); @Override CliResult execute(String... args); void setOverrides(final LegacyOverridesMixin overrides);  }