Merge pull request #14886 from Artsiom Yudovin

* gh-14886:
  Polish "Handle StepRegistry connect/read timeout deprecation"
  Handle StepRegistry connect/read timeout deprecation
pull/30512/head
Andy Wilkinson 6 years ago
commit ac9c003a65

@ -19,6 +19,7 @@ package org.springframework.boot.actuate.autoconfigure.metrics.export.appoptics;
import io.micrometer.appoptics.AppOpticsConfig; import io.micrometer.appoptics.AppOpticsConfig;
import io.micrometer.appoptics.AppOpticsMeterRegistry; import io.micrometer.appoptics.AppOpticsMeterRegistry;
import io.micrometer.core.instrument.Clock; import io.micrometer.core.instrument.Clock;
import io.micrometer.core.ipc.http.HttpUrlConnectionSender;
import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
@ -38,6 +39,7 @@ import org.springframework.context.annotation.Configuration;
* {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to AppOptics. * {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to AppOptics.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Artsiom Yudovin
* @since 2.1.0 * @since 2.1.0
*/ */
@Configuration @Configuration
@ -50,17 +52,27 @@ import org.springframework.context.annotation.Configuration;
@EnableConfigurationProperties(AppOpticsProperties.class) @EnableConfigurationProperties(AppOpticsProperties.class)
public class AppOpticsMetricsExportAutoConfiguration { public class AppOpticsMetricsExportAutoConfiguration {
private final AppOpticsProperties properties;
public AppOpticsMetricsExportAutoConfiguration(AppOpticsProperties properties) {
this.properties = properties;
}
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public AppOpticsConfig appOpticsConfig(AppOpticsProperties appOpticsProperties) { public AppOpticsConfig appOpticsConfig() {
return new AppOpticsPropertiesConfigAdapter(appOpticsProperties); return new AppOpticsPropertiesConfigAdapter(this.properties);
} }
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public AppOpticsMeterRegistry appOpticsMeterRegistry(AppOpticsConfig config, public AppOpticsMeterRegistry appOpticsMeterRegistry(AppOpticsConfig config,
Clock clock) { Clock clock) {
return new AppOpticsMeterRegistry(config, clock); return AppOpticsMeterRegistry.builder(config).clock(clock)
.httpClient(
new HttpUrlConnectionSender(this.properties.getConnectTimeout(),
this.properties.getReadTimeout()))
.build();
} }
} }

@ -17,6 +17,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics.export.datadog; package org.springframework.boot.actuate.autoconfigure.metrics.export.datadog;
import io.micrometer.core.instrument.Clock; import io.micrometer.core.instrument.Clock;
import io.micrometer.core.ipc.http.HttpUrlConnectionSender;
import io.micrometer.datadog.DatadogConfig; import io.micrometer.datadog.DatadogConfig;
import io.micrometer.datadog.DatadogMeterRegistry; import io.micrometer.datadog.DatadogMeterRegistry;
@ -38,6 +39,7 @@ import org.springframework.context.annotation.Configuration;
* {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Datadog. * {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Datadog.
* *
* @author Jon Schneider * @author Jon Schneider
* @author Artsiom Yudovin
* @since 2.0.0 * @since 2.0.0
*/ */
@Configuration @Configuration
@ -50,17 +52,27 @@ import org.springframework.context.annotation.Configuration;
@EnableConfigurationProperties(DatadogProperties.class) @EnableConfigurationProperties(DatadogProperties.class)
public class DatadogMetricsExportAutoConfiguration { public class DatadogMetricsExportAutoConfiguration {
private final DatadogProperties properties;
public DatadogMetricsExportAutoConfiguration(DatadogProperties properties) {
this.properties = properties;
}
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public DatadogConfig datadogConfig(DatadogProperties datadogProperties) { public DatadogConfig datadogConfig() {
return new DatadogPropertiesConfigAdapter(datadogProperties); return new DatadogPropertiesConfigAdapter(this.properties);
} }
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public DatadogMeterRegistry datadogMeterRegistry(DatadogConfig datadogConfig, public DatadogMeterRegistry datadogMeterRegistry(DatadogConfig datadogConfig,
Clock clock) { Clock clock) {
return new DatadogMeterRegistry(datadogConfig, clock); return DatadogMeterRegistry.builder(datadogConfig).clock(clock)
.httpClient(
new HttpUrlConnectionSender(this.properties.getConnectTimeout(),
this.properties.getReadTimeout()))
.build();
} }
} }

@ -17,6 +17,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics.export.dynatrace; package org.springframework.boot.actuate.autoconfigure.metrics.export.dynatrace;
import io.micrometer.core.instrument.Clock; import io.micrometer.core.instrument.Clock;
import io.micrometer.core.ipc.http.HttpUrlConnectionSender;
import io.micrometer.dynatrace.DynatraceConfig; import io.micrometer.dynatrace.DynatraceConfig;
import io.micrometer.dynatrace.DynatraceMeterRegistry; import io.micrometer.dynatrace.DynatraceMeterRegistry;
@ -38,6 +39,7 @@ import org.springframework.context.annotation.Configuration;
* {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Dynatrace. * {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Dynatrace.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Artsiom Yudovin
* @since 2.1.0 * @since 2.1.0
*/ */
@Configuration @Configuration
@ -50,17 +52,27 @@ import org.springframework.context.annotation.Configuration;
@EnableConfigurationProperties(DynatraceProperties.class) @EnableConfigurationProperties(DynatraceProperties.class)
public class DynatraceMetricsExportAutoConfiguration { public class DynatraceMetricsExportAutoConfiguration {
private final DynatraceProperties properties;
public DynatraceMetricsExportAutoConfiguration(DynatraceProperties properties) {
this.properties = properties;
}
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public DynatraceConfig dynatraceConfig(DynatraceProperties dynatraceProperties) { public DynatraceConfig dynatraceConfig() {
return new DynatracePropertiesConfigAdapter(dynatraceProperties); return new DynatracePropertiesConfigAdapter(this.properties);
} }
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public DynatraceMeterRegistry dynatraceMeterRegistry(DynatraceConfig dynatraceConfig, public DynatraceMeterRegistry dynatraceMeterRegistry(DynatraceConfig dynatraceConfig,
Clock clock) { Clock clock) {
return new DynatraceMeterRegistry(dynatraceConfig, clock); return DynatraceMeterRegistry.builder(dynatraceConfig).clock(clock)
.httpClient(
new HttpUrlConnectionSender(this.properties.getConnectTimeout(),
this.properties.getReadTimeout()))
.build();
} }
} }

@ -17,6 +17,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics.export.elastic; package org.springframework.boot.actuate.autoconfigure.metrics.export.elastic;
import io.micrometer.core.instrument.Clock; import io.micrometer.core.instrument.Clock;
import io.micrometer.core.ipc.http.HttpUrlConnectionSender;
import io.micrometer.elastic.ElasticConfig; import io.micrometer.elastic.ElasticConfig;
import io.micrometer.elastic.ElasticMeterRegistry; import io.micrometer.elastic.ElasticMeterRegistry;
@ -38,6 +39,7 @@ import org.springframework.context.annotation.Configuration;
* {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Elastic. * {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Elastic.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Artsiom Yudovin
* @since 2.1.0 * @since 2.1.0
*/ */
@Configuration @Configuration
@ -50,17 +52,27 @@ import org.springframework.context.annotation.Configuration;
@EnableConfigurationProperties(ElasticProperties.class) @EnableConfigurationProperties(ElasticProperties.class)
public class ElasticMetricsExportAutoConfiguration { public class ElasticMetricsExportAutoConfiguration {
private final ElasticProperties properties;
public ElasticMetricsExportAutoConfiguration(ElasticProperties properties) {
this.properties = properties;
}
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public ElasticConfig elasticConfig(ElasticProperties elasticProperties) { public ElasticConfig elasticConfig() {
return new ElasticPropertiesConfigAdapter(elasticProperties); return new ElasticPropertiesConfigAdapter(this.properties);
} }
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public ElasticMeterRegistry elasticMeterRegistry(ElasticConfig elasticConfig, public ElasticMeterRegistry elasticMeterRegistry(ElasticConfig elasticConfig,
Clock clock) { Clock clock) {
return new ElasticMeterRegistry(elasticConfig, clock); return ElasticMeterRegistry.builder(elasticConfig).clock(clock)
.httpClient(
new HttpUrlConnectionSender(this.properties.getConnectTimeout(),
this.properties.getReadTimeout()))
.build();
} }
} }

@ -17,6 +17,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics.export.humio; package org.springframework.boot.actuate.autoconfigure.metrics.export.humio;
import io.micrometer.core.instrument.Clock; import io.micrometer.core.instrument.Clock;
import io.micrometer.core.ipc.http.HttpUrlConnectionSender;
import io.micrometer.humio.HumioConfig; import io.micrometer.humio.HumioConfig;
import io.micrometer.humio.HumioMeterRegistry; import io.micrometer.humio.HumioMeterRegistry;
@ -38,6 +39,7 @@ import org.springframework.context.annotation.Configuration;
* {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Humio. * {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Humio.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Artsiom Yudovin
* @since 2.1.0 * @since 2.1.0
*/ */
@Configuration @Configuration
@ -50,16 +52,27 @@ import org.springframework.context.annotation.Configuration;
@EnableConfigurationProperties(HumioProperties.class) @EnableConfigurationProperties(HumioProperties.class)
public class HumioMetricsExportAutoConfiguration { public class HumioMetricsExportAutoConfiguration {
private final HumioProperties properties;
public HumioMetricsExportAutoConfiguration(HumioProperties properties) {
this.properties = properties;
}
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public HumioConfig humioConfig(HumioProperties humioProperties) { public HumioConfig humioConfig() {
return new HumioPropertiesConfigAdapter(humioProperties); return new HumioPropertiesConfigAdapter(this.properties);
} }
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public HumioMeterRegistry humioMeterRegistry(HumioConfig humioConfig, Clock clock) { public HumioMeterRegistry humioMeterRegistry(HumioConfig humioConfig, Clock clock) {
return new HumioMeterRegistry(humioConfig, clock); return HumioMeterRegistry.builder(humioConfig).clock(clock)
.httpClient(
new HttpUrlConnectionSender(this.properties.getConnectTimeout(),
this.properties.getReadTimeout()))
.build();
} }
} }

@ -17,6 +17,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics.export.influx; package org.springframework.boot.actuate.autoconfigure.metrics.export.influx;
import io.micrometer.core.instrument.Clock; import io.micrometer.core.instrument.Clock;
import io.micrometer.core.ipc.http.HttpUrlConnectionSender;
import io.micrometer.influx.InfluxConfig; import io.micrometer.influx.InfluxConfig;
import io.micrometer.influx.InfluxMeterRegistry; import io.micrometer.influx.InfluxMeterRegistry;
@ -38,6 +39,7 @@ import org.springframework.context.annotation.Configuration;
* {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Influx. * {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Influx.
* *
* @author Jon Schneider * @author Jon Schneider
* @author Artsiom Yudovin
* @since 2.0.0 * @since 2.0.0
*/ */
@Configuration @Configuration
@ -50,17 +52,28 @@ import org.springframework.context.annotation.Configuration;
@EnableConfigurationProperties(InfluxProperties.class) @EnableConfigurationProperties(InfluxProperties.class)
public class InfluxMetricsExportAutoConfiguration { public class InfluxMetricsExportAutoConfiguration {
private final InfluxProperties properties;
public InfluxMetricsExportAutoConfiguration(InfluxProperties properties) {
this.properties = properties;
}
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public InfluxConfig influxConfig(InfluxProperties influxProperties) { public InfluxConfig influxConfig() {
return new InfluxPropertiesConfigAdapter(influxProperties); return new InfluxPropertiesConfigAdapter(this.properties);
} }
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public InfluxMeterRegistry influxMeterRegistry(InfluxConfig influxConfig, public InfluxMeterRegistry influxMeterRegistry(InfluxConfig influxConfig, Clock clock,
Clock clock) { InfluxProperties influxProperties) {
return new InfluxMeterRegistry(influxConfig, clock); return InfluxMeterRegistry.builder(influxConfig).clock(clock)
.httpClient(
new HttpUrlConnectionSender(this.properties.getConnectTimeout(),
this.properties.getReadTimeout()))
.build();
} }
} }

@ -17,6 +17,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics.export.kairos; package org.springframework.boot.actuate.autoconfigure.metrics.export.kairos;
import io.micrometer.core.instrument.Clock; import io.micrometer.core.instrument.Clock;
import io.micrometer.core.ipc.http.HttpUrlConnectionSender;
import io.micrometer.kairos.KairosConfig; import io.micrometer.kairos.KairosConfig;
import io.micrometer.kairos.KairosMeterRegistry; import io.micrometer.kairos.KairosMeterRegistry;
@ -38,6 +39,7 @@ import org.springframework.context.annotation.Configuration;
* {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to KairosDB. * {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to KairosDB.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Artsiom Yudovin
* @since 2.1.0 * @since 2.1.0
*/ */
@Configuration @Configuration
@ -50,17 +52,28 @@ import org.springframework.context.annotation.Configuration;
@EnableConfigurationProperties(KairosProperties.class) @EnableConfigurationProperties(KairosProperties.class)
public class KairosMetricsExportAutoConfiguration { public class KairosMetricsExportAutoConfiguration {
private final KairosProperties properties;
public KairosMetricsExportAutoConfiguration(KairosProperties properties) {
this.properties = properties;
}
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public KairosConfig kairosConfig(KairosProperties kairosProperties) { public KairosConfig kairosConfig() {
return new KairosPropertiesConfigAdapter(kairosProperties); return new KairosPropertiesConfigAdapter(this.properties);
} }
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public KairosMeterRegistry kairosMeterRegistry(KairosConfig kairosConfig, public KairosMeterRegistry kairosMeterRegistry(KairosConfig kairosConfig,
Clock clock) { Clock clock) {
return new KairosMeterRegistry(kairosConfig, clock); return KairosMeterRegistry.builder(kairosConfig).clock(clock)
.httpClient(
new HttpUrlConnectionSender(this.properties.getConnectTimeout(),
this.properties.getReadTimeout()))
.build();
} }
} }

@ -17,6 +17,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics.export.newrelic; package org.springframework.boot.actuate.autoconfigure.metrics.export.newrelic;
import io.micrometer.core.instrument.Clock; import io.micrometer.core.instrument.Clock;
import io.micrometer.core.ipc.http.HttpUrlConnectionSender;
import io.micrometer.newrelic.NewRelicConfig; import io.micrometer.newrelic.NewRelicConfig;
import io.micrometer.newrelic.NewRelicMeterRegistry; import io.micrometer.newrelic.NewRelicMeterRegistry;
@ -39,6 +40,7 @@ import org.springframework.context.annotation.Configuration;
* *
* @author Jon Schneider * @author Jon Schneider
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Artsiom Yudovin
* @since 2.0.0 * @since 2.0.0
*/ */
@Configuration @Configuration
@ -51,17 +53,28 @@ import org.springframework.context.annotation.Configuration;
@EnableConfigurationProperties(NewRelicProperties.class) @EnableConfigurationProperties(NewRelicProperties.class)
public class NewRelicMetricsExportAutoConfiguration { public class NewRelicMetricsExportAutoConfiguration {
private final NewRelicProperties properties;
public NewRelicMetricsExportAutoConfiguration(NewRelicProperties properties) {
this.properties = properties;
}
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public NewRelicConfig newRelicConfig(NewRelicProperties props) { public NewRelicConfig newRelicConfig() {
return new NewRelicPropertiesConfigAdapter(props); return new NewRelicPropertiesConfigAdapter(this.properties);
} }
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public NewRelicMeterRegistry newRelicMeterRegistry(NewRelicConfig newRelicConfig, public NewRelicMeterRegistry newRelicMeterRegistry(NewRelicConfig newRelicConfig,
Clock clock) { Clock clock) {
return new NewRelicMeterRegistry(newRelicConfig, clock); return NewRelicMeterRegistry.builder(newRelicConfig).clock(clock)
.httpClient(
new HttpUrlConnectionSender(this.properties.getConnectTimeout(),
this.properties.getReadTimeout()))
.build();
} }
} }

@ -26,6 +26,7 @@ import io.micrometer.core.instrument.step.StepRegistryConfig;
* @param <T> the properties type * @param <T> the properties type
* @author Jon Schneider * @author Jon Schneider
* @author Phillip Webb * @author Phillip Webb
* @author Artsiom Yudovin
* @since 2.0.0 * @since 2.0.0
*/ */
public abstract class StepRegistryPropertiesConfigAdapter<T extends StepRegistryProperties> public abstract class StepRegistryPropertiesConfigAdapter<T extends StepRegistryProperties>
@ -55,16 +56,6 @@ public abstract class StepRegistryPropertiesConfigAdapter<T extends StepRegistry
return get(T::isEnabled, StepRegistryConfig.super::enabled); return get(T::isEnabled, StepRegistryConfig.super::enabled);
} }
@Override
public Duration connectTimeout() {
return get(T::getConnectTimeout, StepRegistryConfig.super::connectTimeout);
}
@Override
public Duration readTimeout() {
return get(T::getReadTimeout, StepRegistryConfig.super::readTimeout);
}
@Override @Override
public int numThreads() { public int numThreads() {
return get(T::getNumThreads, StepRegistryConfig.super::numThreads); return get(T::getNumThreads, StepRegistryConfig.super::numThreads);

@ -17,6 +17,7 @@
package org.springframework.boot.actuate.autoconfigure.metrics.export.wavefront; package org.springframework.boot.actuate.autoconfigure.metrics.export.wavefront;
import io.micrometer.core.instrument.Clock; import io.micrometer.core.instrument.Clock;
import io.micrometer.core.ipc.http.HttpUrlConnectionSender;
import io.micrometer.wavefront.WavefrontConfig; import io.micrometer.wavefront.WavefrontConfig;
import io.micrometer.wavefront.WavefrontMeterRegistry; import io.micrometer.wavefront.WavefrontMeterRegistry;
@ -38,6 +39,7 @@ import org.springframework.context.annotation.Configuration;
* {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Wavefront. * {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Wavefront.
* *
* @author Jon Schneider * @author Jon Schneider
* @author Artsiom Yudovin
* @since 2.0.0 * @since 2.0.0
*/ */
@Configuration @Configuration
@ -50,17 +52,27 @@ import org.springframework.context.annotation.Configuration;
@EnableConfigurationProperties(WavefrontProperties.class) @EnableConfigurationProperties(WavefrontProperties.class)
public class WavefrontMetricsExportAutoConfiguration { public class WavefrontMetricsExportAutoConfiguration {
private final WavefrontProperties properties;
public WavefrontMetricsExportAutoConfiguration(WavefrontProperties properties) {
this.properties = properties;
}
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public WavefrontConfig wavefrontConfig(WavefrontProperties props) { public WavefrontConfig wavefrontConfig() {
return new WavefrontPropertiesConfigAdapter(props); return new WavefrontPropertiesConfigAdapter(this.properties);
} }
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public WavefrontMeterRegistry wavefrontMeterRegistry(WavefrontConfig wavefrontConfig, public WavefrontMeterRegistry wavefrontMeterRegistry(WavefrontConfig wavefrontConfig,
Clock clock) { Clock clock) {
return new WavefrontMeterRegistry(wavefrontConfig, clock); return WavefrontMeterRegistry.builder(wavefrontConfig).clock(clock)
.httpClient(
new HttpUrlConnectionSender(this.properties.getConnectTimeout(),
this.properties.getReadTimeout()))
.build();
} }
} }

@ -16,7 +16,6 @@
package org.springframework.boot.actuate.autoconfigure.metrics.export.humio; package org.springframework.boot.actuate.autoconfigure.metrics.export.humio;
import java.time.Duration;
import java.util.Collections; import java.util.Collections;
import org.junit.Test; import org.junit.Test;
@ -38,14 +37,6 @@ public class HumioPropertiesConfigAdapterTests {
.isEqualTo("ABC123"); .isEqualTo("ABC123");
} }
@Test
public void whenPropertiesConnectTimeoutIsSetAdapterConnectTimeoutReturnsIt() {
HumioProperties properties = new HumioProperties();
properties.setConnectTimeout(Duration.ofSeconds(10));
assertThat(new HumioPropertiesConfigAdapter(properties).connectTimeout())
.isEqualTo(Duration.ofSeconds(10));
}
@Test @Test
public void whenPropertiesRepositoryIsSetAdapterRepositoryReturnsIt() { public void whenPropertiesRepositoryIsSetAdapterRepositoryReturnsIt() {
HumioProperties properties = new HumioProperties(); HumioProperties properties = new HumioProperties();

@ -28,6 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @param <P> properties used by the tests * @param <P> properties used by the tests
* @param <A> adapter used by the tests * @param <A> adapter used by the tests
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Artsiom Yudovin
*/ */
public abstract class StepRegistryPropertiesConfigAdapterTests<P extends StepRegistryProperties, A extends StepRegistryPropertiesConfigAdapter<P>> { public abstract class StepRegistryPropertiesConfigAdapterTests<P extends StepRegistryProperties, A extends StepRegistryPropertiesConfigAdapter<P>> {
@ -50,22 +51,6 @@ public abstract class StepRegistryPropertiesConfigAdapterTests<P extends StepReg
assertThat(createConfigAdapter(properties).enabled()).isFalse(); assertThat(createConfigAdapter(properties).enabled()).isFalse();
} }
@Test
public void whenPropertiesConnectTimeoutIsSetAdapterConnectTimeoutReturnsIt() {
P properties = createProperties();
properties.setConnectTimeout(Duration.ofMinutes(42));
assertThat(createConfigAdapter(properties).connectTimeout())
.isEqualTo(Duration.ofMinutes(42));
}
@Test
public void whenPropertiesReadTimeoutIsSetAdapterReadTimeoutReturnsIt() {
P properties = createProperties();
properties.setReadTimeout(Duration.ofMillis(42));
assertThat(createConfigAdapter(properties).readTimeout())
.isEqualTo(Duration.ofMillis(42));
}
@Test @Test
public void whenPropertiesNumThreadsIsSetAdapterNumThreadsReturnsIt() { public void whenPropertiesNumThreadsIsSetAdapterNumThreadsReturnsIt() {
P properties = createProperties(); P properties = createProperties();

Loading…
Cancel
Save