CloudConfigInstallVariables implements CloudConfigOptions { static ConfigServer[] toConfigServers(String configserversString) { return multiValueParameterStream(configserversString) .map(CloudConfigInstallVariables::toConfigServer) .toArray(ConfigServer[]::new); }  @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 public void test_configserver_parsing() { CloudConfigOptions.ConfigServer[] parsed = toConfigServers("myhost.mydomain.com"); assertEquals(1, parsed.length); }
@Test public void port_can_be_configured() { CloudConfigOptions.ConfigServer[] parsed = toConfigServers("myhost:123"); int port = parsed[0].port.get(); assertEquals(123, port); }
@Test public void multiple_spaces_are_supported() { CloudConfigOptions.ConfigServer[] parsed = toConfigServers("test1 test2"); assertEquals(2, parsed.length); List<String> hostNames = Arrays.stream(parsed).map(cs -> cs.hostName).collect(Collectors.toList()); assertTrue(hostNames.containsAll(Arrays.asList("test1", "test2"))); }