### Question:
CliOptions { Config setup() { return Config.builder() .withPlugins(getPlugins()) .withPluginDir(getPluginDir()) .withJenkinsUc(getUpdateCenter()) .withJenkinsUcExperimental(getExperimentalUpdateCenter()) .withJenkinsIncrementalsRepoMirror(getIncrementalsMirror()) .withJenkinsPluginInfo(getPluginInfo()) .withJenkinsWar(getJenkinsWar()) .withShowWarnings(isShowWarnings()) .withShowAllWarnings(isShowAllWarnings()) .withShowPluginsToBeDownloaded(isShowPluginsToBeDownloaded()) .withShowAvailableUpdates(isShowAvailableUpdates()) .withOutputFormat(getOutputFormat()) .withIsVerbose(isVerbose()) .withDoDownload(!isNoDownload()) .withUseLatestSpecified(isUseLatestSpecified()) .withUseLatestAll(isUseLatestAll()) .withSkipFailedPlugins(isSkipFailedPlugins()) .build(); }  OutputFormat getOutputFormat(); boolean isShowAvailableUpdates(); boolean isVerbose(); String appendFilePathIfNotPresent(@NonNull String updateCenter); @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") void showVersion(); boolean isShowHelp(); boolean isUseLatestSpecified(); boolean isSkipFailedPlugins(); boolean isUseLatestAll(); InputStream getPropertiesInputStream(String path); boolean isShowVersion();  }### Answer:
@Test public void setupPluginsTest() throws CmdLineException, IOException, URISyntaxException { File pluginTxtFile = new File(this.getClass().getResource("/plugins.txt").toURI()); File pluginFile = temporaryFolder.newFile("plugins.txt"); FileUtils.copyFile(pluginTxtFile, pluginFile); parser.parseArgument("--plugin-file", pluginFile.toString(), "--plugins", "ssh-slaves:1.10 mailer cobertura:experimental"); List<Plugin> requestedPlugins = new ArrayList<>(txtRequestedPlugins); requestedPlugins.add(new Plugin("ssh-slaves", "1.10", null, null)); requestedPlugins.add(new Plugin("mailer", "latest", null, null)); requestedPlugins.add(new Plugin("cobertura", "experimental", null, null)); Config cfg = options.setup(); assertConfigHasPlugins(cfg, requestedPlugins); }
@Test public void setupPluginsTest2() throws CmdLineException, IOException, URISyntaxException { File pluginTxtFile = new File(this.getClass().getResource("/plugins.yaml").toURI()); File pluginFile = temporaryFolder.newFile("plugins.yaml"); FileUtils.copyFile(pluginTxtFile, pluginFile); parser.parseArgument("--plugin-file", pluginFile.toString(), "--plugins", "ssh-slaves:1.10 mailer cobertura:experimental"); List<Plugin> requestedPlugins = new ArrayList<>(txtRequestedPlugins); requestedPlugins.add(new Plugin("ssh-slaves", "1.10", null, null)); requestedPlugins.add(new Plugin("mailer", "latest", null, null)); requestedPlugins.add(new Plugin("cobertura", "experimental", null, null)); Config cfg = options.setup(); assertConfigHasPlugins(cfg, requestedPlugins); }
@Test public void noDownloadTest() throws CmdLineException { parser.parseArgument("--no-download"); Config cfg = options.setup(); assertThat(cfg.doDownload()).isFalse(); }
@Test public void downloadTest() throws CmdLineException { parser.parseArgument(); Config cfg = options.setup(); assertThat(cfg.doDownload()).isTrue(); }