ClientOptions { private ClientOptions() { } private  ClientOptions(); @Deprecated  ClientOptions(long timeout, TimeUnit timeUnit); private  ClientOptions(Builder builder); ClientOptions copyWithMetricsClient(MetricsClient metricsClient); long getRpcTimeoutMillis(); String getDeploymentStr(); String getClientAppName(); MetricsClient getMetricsClient();  }
@Test public void testClientOptions() { ClientOptions options = new ClientOptions.Builder() .setClientAppName("client1") .setDeploymentStr("staging") .setRpcTimeout(123) .setMetricsClient(null) .build(); Assert.assertEquals("client1", options.getClientAppName()); Assert.assertEquals("staging", options.getDeploymentStr()); Assert.assertEquals(123L, options.getRpcTimeoutMillis()); Assert.assertEquals(null, options.getMetricsClient()); MetricsClient metricsClient = new DefaultMetricsClient(); options = options.copyWithMetricsClient(metricsClient); Assert.assertEquals("client1", options.getClientAppName()); Assert.assertEquals("staging", options.getDeploymentStr()); Assert.assertEquals(123L, options.getRpcTimeoutMillis()); Assert.assertEquals(metricsClient, options.getMetricsClient()); }