CloudConfigInstallVariables implements CloudConfigOptions { static ConfigServer toConfigServer(String configserverString) { try { String[] hostPortTuple = configserverString.split(":"); if (configserverString.contains(":")) { return new ConfigServer(hostPortTuple[0], Optional.of(Integer.parseInt(hostPortTuple[1]))); } else { return new ConfigServer(configserverString, Optional.empty()); } } catch (Exception e) { throw new IllegalArgumentException("Invalid config server " + configserverString, e); } }  @Override Optional<Integer> rpcPort(); @Override Optional<Boolean> multiTenant(); @Override ConfigServer[] allConfigServers(); @Override int[] configServerZookeeperIds(); @Override Optional<Long> zookeeperBarrierTimeout(); @Override Optional<Long> sessionLifeTimeSecs(); @Override String[] configModelPluginDirs(); @Override Optional<Integer> zookeeperClientPort(); @Override Optional<Integer> zookeeperQuorumPort(); @Override Optional<Integer> zookeeperElectionPort(); @Override Optional<String> environment(); @Override Optional<String> region(); @Override Optional<String> system(); @Override Optional<Boolean> useVespaVersionInRequest(); @Override Optional<Boolean> hostedVespa(); @Override Optional<String> loadBalancerAddress(); @Override Optional<String> athenzDnsSuffix(); @Override Optional<String> ztsUrl();  }
@Test(expected = IllegalArgumentException.class) public void missing_port_gives_exception() { toConfigServer("myhost:"); }
@Test(expected = IllegalArgumentException.class) public void non_numeric_port_gives_exception() { toConfigServer("myhost:non-numeric"); }