Config { public static ConfigBuilder builder() { return new ConfigBuilder(); } private  Config( ConfigBuilder builder ); Logging logging(); boolean logLeakedSessions(); long idleTimeBeforeConnectionTest(); long maxConnectionLifetimeMillis(); int connectionTimeoutMillis(); int maxConnectionPoolSize(); long connectionAcquisitionTimeoutMillis(); boolean encrypted(); TrustStrategy trustStrategy(); ServerAddressResolver resolver(); static ConfigBuilder builder(); static Config defaultConfig(); long fetchSize(); int eventLoopThreads(); boolean isMetricsEnabled(); String userAgent();  }
@Test void shouldThrowForNegativeConnectionTimeout() { Config.ConfigBuilder builder = Config.builder(); assertThrows( IllegalArgumentException.class, () -> builder.withConnectionTimeout( -42, TimeUnit.SECONDS ) ); }
@Test void shouldThrowForTooLargeConnectionTimeout() { Config.ConfigBuilder builder = Config.builder(); assertThrows( IllegalArgumentException.class, () -> builder.withConnectionTimeout( Long.MAX_VALUE - 42, TimeUnit.SECONDS ) ); }
@Test void shouldNotAllowNegativeMaxRetryTimeMs() { Config.ConfigBuilder builder = Config.builder(); assertThrows( IllegalArgumentException.class, () -> builder.withMaxTransactionRetryTime( -42, TimeUnit.SECONDS ) ); }
@Test void shouldDisallowZeroMaxConnectionPoolSize() { IllegalArgumentException e = assertThrows( IllegalArgumentException.class, () -> Config.builder().withMaxConnectionPoolSize( 0 ).build() ); assertEquals( "Zero value is not supported", e.getMessage() ); }
@Test void shouldNotAllowNullResolver() { assertThrows( NullPointerException.class, () -> Config.builder().withResolver( null ) ); }
@Test void shouldErrorWithInvalidUserAgent() { assertThrows( IllegalArgumentException.class, () -> Config.builder().withUserAgent( null ).build() ); assertThrows( IllegalArgumentException.class, () -> Config.builder().withUserAgent( "" ).build() ); }