TimeLockClientConfig { public ServerListConfig toNamespacedServerList() { return ServerListConfigs.namespaceUris(serversList(), getClientOrThrow()); }  @Deprecated abstract Optional<String> client(); @JsonIgnore @Value.Lazy String getClientOrThrow(); @Deprecated @Value.Default ServerListConfig serversList(); ServerListConfig toNamespacedServerList();  }
@Test public void canGetNamespacedConfigsFromTimelockBlock() { ServerListConfig namespacedConfig = MULTIPLE_SERVER_CONFIG.toNamespacedServerList(); assertThat(namespacedConfig.servers(), hasItems(SERVER_1 + "/" + CLIENT, SERVER_2 + "/" + CLIENT)); }
@Test public void preservesSslOnConversionToNamespacedServerListIfPresent() { ServerListConfig namespacedConfig = CLIENT_CONFIG.toNamespacedServerList(); assertThat(namespacedConfig.sslConfiguration(), equalTo(Optional.of(SSL_CONFIGURATION))); }
@Test public void preservesAbsenceOfSslOnConversionToNamespacedServerListIfAbsent() { ImmutableServerListConfig serversListWithoutSsl = ImmutableServerListConfig.copyOf(SERVERS_LIST) .withSslConfiguration(Optional.empty()); TimeLockClientConfig config = ImmutableTimeLockClientConfig.copyOf(CLIENT_CONFIG) .withServersList(serversListWithoutSsl); assertThat(config.toNamespacedServerList().sslConfiguration(), equalTo(Optional.empty())); }