@Test public void testComputeTargetsMultipleDomainsFromConfig() throws Exception { final String[] args = { SUBCOMMAND, SERVICE }; final File configDir = temporaryFolder.newFolder(CliConfig.getConfigDirName()); final File configFile = new File(configDir.getAbsolutePath() + File.separator + CliConfig.getConfigFileName()); try (final FileOutputStream outFile = new FileOutputStream(configFile)) { final ByteBuffer byteBuffer = Charsets.UTF_8.encode( "{\"domains\":[\"" + DOMAINS[0] + "\", \"" + DOMAINS[1] + "\", \"" + DOMAINS[2] + "\"]}"); outFile.write(byteBuffer.array(), 0, byteBuffer.remaining()); System.setProperty("user.home", temporaryFolder.getRoot().getAbsolutePath()); final CliParser cliParser = new CliParser(args); final List<Target> targets = cliParser.getTargets(); final List<Target> expectedTargets = Target.from( SRV, ImmutableList.of(DOMAINS[0], DOMAINS[1], DOMAINS[2])); assertEquals(expectedTargets, targets); } }
public List<Target> getTargets() { return targets; }
CliParser { public List<Target> getTargets() { return targets; } }
CliParser { public List<Target> getTargets() { return targets; } CliParser(final String... args); }
CliParser { public List<Target> getTargets() { return targets; } CliParser(final String... args); List<Target> getTargets(); String getUsername(); boolean getJson(); Namespace getNamespace(); CliCommand getCommand(); LoggingConfig getLoggingConfig(); }
CliParser { public List<Target> getTargets() { return targets; } CliParser(final String... args); List<Target> getTargets(); String getUsername(); boolean getJson(); Namespace getNamespace(); CliCommand getCommand(); LoggingConfig getLoggingConfig();  }