From 715db153e35788c91fafb8d191447fcef92933ef Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 27 Feb 2019 10:16:10 +0100 Subject: [PATCH] Polish "Remove code deprecated in 2.1" Closes gh-16013 --- .../jmx/DefaultEndpointObjectNameFactory.java | 21 +--- .../endpoint/jmx/JmxEndpointProperties.java | 19 +--- .../metrics/JvmMetricsAutoConfiguration.java | 4 +- .../LogbackMetricsAutoConfiguration.java | 4 +- .../SystemMetricsAutoConfiguration.java | 6 +- ...itional-spring-configuration-metadata.json | 101 +++++++++-------- ...DefaultEndpointObjectNameFactoryTests.java | 21 +--- .../JvmMetricsAutoConfigurationTests.java | 13 +-- .../LogbackMetricsAutoConfigurationTests.java | 11 +- .../SystemMetricsAutoConfigurationTests.java | 29 +---- .../boot/actuate/endpoint/web/PathMapper.java | 2 +- .../health/CompositeHealthIndicator.java | 2 +- .../CompositeReactiveHealthIndicator.java | 5 +- ...mpositeReactiveHealthIndicatorFactory.java | 73 ------------- .../web/reactive/server/MetricsWebFilter.java | 2 +- .../web/servlet/WebMvcMetricsFilter.java | 3 +- .../system/DiskSpaceHealthIndicator.java | 2 +- ...teReactiveHealthIndicatorFactoryTests.java | 103 ------------------ .../autoconfigure/amqp/RabbitProperties.java | 14 +-- .../batch/JobLauncherCommandLineRunner.java | 2 +- .../cassandra/CassandraAutoConfiguration.java | 7 -- .../cassandra/CassandraProperties.java | 56 +--------- .../influx/InfluxDbAutoConfiguration.java | 21 +--- .../JmsPoolConnectionFactoryProperties.java | 13 +-- .../autoconfigure/kafka/KafkaProperties.java | 17 +-- .../oauth2/client/OAuth2ClientProperties.java | 12 +- .../autoconfigure/web/ServerProperties.java | 17 --- .../TomcatWebServerFactoryCustomizer.java | 9 +- .../amqp/RabbitAutoConfigurationTests.java | 14 +-- .../InfluxDbAutoConfigurationTests.java | 41 +------ .../ActiveMQAutoConfigurationTests.java | 18 +-- .../ArtemisAutoConfigurationTests.java | 15 --- .../kafka/KafkaAutoConfigurationTests.java | 16 --- ...TomcatWebServerFactoryCustomizerTests.java | 10 -- .../boot/web/client/RestTemplateBuilder.java | 2 +- .../AbstractFilterRegistrationBean.java | 2 +- .../web/servlet/FilterRegistrationBean.java | 2 +- .../web/servlet/MultipartConfigFactory.java | 2 +- .../web/client/RestTemplateBuilderTests.java | 18 --- .../servlet/MultipartConfigFactoryTests.java | 2 +- 40 files changed, 88 insertions(+), 643 deletions(-) delete mode 100644 spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicatorFactory.java delete mode 100644 spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicatorFactoryTests.java diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java index 330969c5f7..a03a8241c5 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,23 +48,8 @@ class DefaultEndpointObjectNameFactory implements EndpointObjectNameFactory { this.properties = properties; this.mBeanServer = mBeanServer; this.contextId = contextId; - this.uniqueNames = determineUniqueNames(environment, properties); - } - - @SuppressWarnings("deprecation") - private static boolean determineUniqueNames(Environment environment, - JmxEndpointProperties properties) { - Boolean uniqueNames = environment.getProperty("spring.jmx.unique-names", - Boolean.class); - Boolean endpointUniqueNames = properties.getUniqueNames(); - if (uniqueNames == null) { - return (endpointUniqueNames != null) ? endpointUniqueNames : false; - } - if (endpointUniqueNames != null & !uniqueNames.equals(endpointUniqueNames)) { - throw new IllegalArgumentException( - "Configuration mismatch, 'management.endpoints.jmx.unique-names' is deprecated, use only 'spring.jmx.unique-names'"); - } - return uniqueNames; + this.uniqueNames = environment.getProperty("spring.jmx.unique-names", + Boolean.class, false); } @Override diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointProperties.java index f77cf02b9b..9d0b691bf3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import java.util.Properties; import java.util.Set; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; import org.springframework.core.env.Environment; import org.springframework.util.StringUtils; @@ -41,11 +40,6 @@ public class JmxEndpointProperties { */ private String domain = "org.springframework.boot"; - /** - * Whether unique runtime object names should be ensured. - */ - private Boolean uniqueNames; - /** * Additional static properties to append to all ObjectNames of MBeans representing * Endpoints. @@ -71,17 +65,6 @@ public class JmxEndpointProperties { this.domain = domain; } - @Deprecated - @DeprecatedConfigurationProperty(replacement = "spring.jmx.unique-names") - public Boolean getUniqueNames() { - return this.uniqueNames; - } - - @Deprecated - public void setUniqueNames(Boolean uniqueNames) { - this.uniqueNames = uniqueNames; - } - public Properties getStaticNames() { return this.staticNames; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/JvmMetricsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/JvmMetricsAutoConfiguration.java index 206a8b45e7..70808da956 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/JvmMetricsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/JvmMetricsAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -41,7 +40,6 @@ import org.springframework.context.annotation.Configuration; @AutoConfigureAfter(MetricsAutoConfiguration.class) @ConditionalOnClass(MeterRegistry.class) @ConditionalOnBean(MeterRegistry.class) -@ConditionalOnProperty(value = "management.metrics.binders.jvm.enabled", matchIfMissing = true) public class JvmMetricsAutoConfiguration { @Bean diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/LogbackMetricsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/LogbackMetricsAutoConfiguration.java index 528bc94ea7..c6b9e4656a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/LogbackMetricsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/LogbackMetricsAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; @@ -49,7 +48,6 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnClass({ MeterRegistry.class, LoggerContext.class, LoggerFactory.class }) @ConditionalOnBean(MeterRegistry.class) @Conditional(LogbackLoggingCondition.class) -@ConditionalOnProperty(value = "management.metrics.binders.logback.enabled", matchIfMissing = true) public class LogbackMetricsAutoConfiguration { @Bean diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/SystemMetricsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/SystemMetricsAutoConfiguration.java index 6d306ae124..f8aa852c96 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/SystemMetricsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/SystemMetricsAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -43,21 +42,18 @@ import org.springframework.context.annotation.Configuration; public class SystemMetricsAutoConfiguration { @Bean - @ConditionalOnProperty(value = "management.metrics.binders.uptime.enabled", matchIfMissing = true) @ConditionalOnMissingBean public UptimeMetrics uptimeMetrics() { return new UptimeMetrics(); } @Bean - @ConditionalOnProperty(value = "management.metrics.binders.processor.enabled", matchIfMissing = true) @ConditionalOnMissingBean public ProcessorMetrics processorMetrics() { return new ProcessorMetrics(); } @Bean - @ConditionalOnProperty(name = "management.metrics.binders.files.enabled", matchIfMissing = true) @ConditionalOnMissingBean public FileDescriptorMetrics fileDescriptorMetrics() { return new FileDescriptorMetrics(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 9582bc8e6a..0902cc4d37 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -188,54 +188,6 @@ "name": "management.info.git.mode", "defaultValue": "simple" }, - { - "name": "management.metrics.binders.files.enabled", - "type": "java.lang.Boolean", - "description": "Whether to enable files metrics.", - "defaultValue": true, - "deprecation": { - "replacement": "management.metrics.enable.process.files", - "reason": "Instead, filter 'process.files' metrics." - } - }, - { - "name": "management.metrics.binders.jvm.enabled", - "type": "java.lang.Boolean", - "description": "Whether to enable JVM metrics.", - "defaultValue": true, - "deprecation": { - "replacement": "management.metrics.enable.jvm", - "reason": "Instead, disable JvmMetricsAutoConfiguration or filter 'jvm' metrics." - } - }, - { - "name": "management.metrics.binders.logback.enabled", - "type": "java.lang.Boolean", - "description": "Whether to enable Logback metrics.", - "defaultValue": true, - "deprecation": { - "replacement": "management.metrics.enable.logback", - "reason": "Instead, disable LogbackMetricsAutoConfiguration or filter 'logback' metrics." - } - }, - { - "name": "management.metrics.binders.processor.enabled", - "type": "java.lang.Boolean", - "description": "Whether to enable processor metrics.", - "defaultValue": true, - "deprecation": { - "reason": "Instead, filter 'system.cpu' and 'process.cpu' metrics." - } - }, - { - "name": "management.metrics.binders.uptime.enabled", - "type": "java.lang.Boolean", - "description": "Whether to enable uptime metrics.", - "defaultValue": true, - "deprecation": { - "reason": "Instead, filter 'process.uptime' and 'process.start.time' metrics." - } - }, { "name": "management.metrics.export.jmx.enabled", "type": "java.lang.Boolean", @@ -1278,6 +1230,59 @@ "level": "error" } }, + { + "name": "management.metrics.binders.files.enabled", + "type": "java.lang.Boolean", + "description": "Whether to enable files metrics.", + "defaultValue": true, + "deprecation": { + "level": "error", + "replacement": "management.metrics.enable.process.files", + "reason": "Instead, filter 'process.files' metrics." + } + }, + { + "name": "management.metrics.binders.jvm.enabled", + "type": "java.lang.Boolean", + "description": "Whether to enable JVM metrics.", + "defaultValue": true, + "deprecation": { + "level": "error", + "replacement": "management.metrics.enable.jvm", + "reason": "Instead, disable JvmMetricsAutoConfiguration or filter 'jvm' metrics." + } + }, + { + "name": "management.metrics.binders.logback.enabled", + "type": "java.lang.Boolean", + "description": "Whether to enable Logback metrics.", + "defaultValue": true, + "deprecation": { + "level": "error", + "replacement": "management.metrics.enable.logback", + "reason": "Instead, disable LogbackMetricsAutoConfiguration or filter 'logback' metrics." + } + }, + { + "name": "management.metrics.binders.processor.enabled", + "type": "java.lang.Boolean", + "description": "Whether to enable processor metrics.", + "defaultValue": true, + "deprecation": { + "level": "error", + "reason": "Instead, filter 'system.cpu' and 'process.cpu' metrics." + } + }, + { + "name": "management.metrics.binders.uptime.enabled", + "type": "java.lang.Boolean", + "description": "Whether to enable uptime metrics.", + "defaultValue": true, + "deprecation": { + "level": "error", + "reason": "Instead, filter 'process.uptime' and 'process.start.time' metrics." + } + }, { "name": "management.port", "type": "java.lang.Integer", diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactoryTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactoryTests.java index 53eb6a74b3..04681f14b5 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactoryTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,6 @@ import org.springframework.mock.env.MockEnvironment; import org.springframework.util.ObjectUtils; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; @@ -79,13 +78,6 @@ public class DefaultEndpointObjectNameFactoryTests { assertUniqueObjectName(); } - @Test - @Deprecated - public void generateObjectNameWithUniqueNamesDeprecatedProperty() { - this.properties.setUniqueNames(true); - assertUniqueObjectName(); - } - private void assertUniqueObjectName() { ExposableJmxEndpoint endpoint = endpoint(EndpointId.of("test")); String id = ObjectUtils.getIdentityHexString(endpoint); @@ -94,17 +86,6 @@ public class DefaultEndpointObjectNameFactoryTests { "org.springframework.boot:type=Endpoint,name=Test,identity=" + id); } - @Test - @Deprecated - public void generateObjectNameWithUniqueNamesDeprecatedPropertyMismatchMainProperty() { - this.environment.setProperty("spring.jmx.unique-names", "false"); - this.properties.setUniqueNames(true); - assertThatIllegalArgumentException() - .isThrownBy(() -> generateObjectName(endpoint(EndpointId.of("test")))) - .withMessageContaining("spring.jmx.unique-names") - .withMessageContaining("management.endpoints.jmx.unique-names"); - } - @Test public void generateObjectNameWithStaticNames() { this.properties.getStaticNames().setProperty("counter", "42"); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/JvmMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/JvmMetricsAutoConfigurationTests.java index 9b38f54bb5..3da5a8b932 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/JvmMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/JvmMetricsAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,17 +50,6 @@ public class JvmMetricsAutoConfigurationTests { .hasSingleBean(ClassLoaderMetrics.class)); } - @Test - @Deprecated - public void allowsJvmMetricsToBeDisabled() { - this.contextRunner - .withPropertyValues("management.metrics.binders.jvm.enabled=false") - .run((context) -> assertThat(context).doesNotHaveBean(JvmGcMetrics.class) - .doesNotHaveBean(JvmMemoryMetrics.class) - .doesNotHaveBean(JvmThreadMetrics.class) - .doesNotHaveBean(ClassLoaderMetrics.class)); - } - @Test public void allowsCustomJvmGcMetricsToBeUsed() { this.contextRunner.withUserConfiguration(CustomJvmGcMetricsConfiguration.class) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/LogbackMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/LogbackMetricsAutoConfigurationTests.java index 131027140f..69ec329b78 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/LogbackMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/LogbackMetricsAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,15 +45,6 @@ public class LogbackMetricsAutoConfigurationTests { (context) -> assertThat(context).hasSingleBean(LogbackMetrics.class)); } - @Test - @Deprecated - public void allowsLogbackMetricsToBeDisabled() { - this.contextRunner - .withPropertyValues("management.metrics.binders.logback.enabled=false") - .run((context) -> assertThat(context) - .doesNotHaveBean(LogbackMetrics.class)); - } - @Test public void allowsCustomLogbackMetricsToBeUsed() { this.contextRunner.withUserConfiguration(CustomLogbackMetricsConfiguration.class) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/SystemMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/SystemMetricsAutoConfigurationTests.java index a54736b4d9..5bd8cf0eb8 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/SystemMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/SystemMetricsAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,15 +47,6 @@ public class SystemMetricsAutoConfigurationTests { .run((context) -> assertThat(context).hasSingleBean(UptimeMetrics.class)); } - @Test - @Deprecated - public void allowsUptimeMetricsToBeDisabled() { - this.contextRunner - .withPropertyValues("management.metrics.binders.uptime.enabled=false") - .run((context) -> assertThat(context) - .doesNotHaveBean(UptimeMetrics.class)); - } - @Test public void allowsCustomUptimeMetricsToBeUsed() { this.contextRunner.withUserConfiguration(CustomUptimeMetricsConfiguration.class) @@ -69,15 +60,6 @@ public class SystemMetricsAutoConfigurationTests { (context) -> assertThat(context).hasSingleBean(ProcessorMetrics.class)); } - @Test - @Deprecated - public void allowsProcessorMetricsToBeDisabled() { - this.contextRunner - .withPropertyValues("management.metrics.binders.processor.enabled=false") - .run((context) -> assertThat(context) - .doesNotHaveBean(ProcessorMetrics.class)); - } - @Test public void allowsCustomProcessorMetricsToBeUsed() { this.contextRunner @@ -93,15 +75,6 @@ public class SystemMetricsAutoConfigurationTests { .hasSingleBean(FileDescriptorMetrics.class)); } - @Test - @Deprecated - public void allowsFileDescriptorMetricsToBeDisabled() { - this.contextRunner - .withPropertyValues("management.metrics.binders.files.enabled=false") - .run((context) -> assertThat(context) - .doesNotHaveBean(FileDescriptorMetrics.class)); - } - @Test public void allowsCustomFileDescriptorMetricsToBeUsed() { this.contextRunner diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMapper.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMapper.java index 1bcab63816..434010062c 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMapper.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthIndicator.java index 52d880d647..47ccd44c1e 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java index 1b1a5dd31d..eaab6482ed 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,6 @@ package org.springframework.boot.actuate.health; import java.time.Duration; -import java.util.LinkedHashMap; -import java.util.Map; import java.util.function.Function; import reactor.core.publisher.Flux; @@ -45,7 +43,6 @@ public class CompositeReactiveHealthIndicator implements ReactiveHealthIndicator private final Function, Mono> timeoutCompose; - /** * Create a new {@link CompositeReactiveHealthIndicator} from the indicators in the * given {@code registry}. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicatorFactory.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicatorFactory.java deleted file mode 100644 index 7fcf374622..0000000000 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicatorFactory.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2012-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.actuate.health; - -import java.util.Map; -import java.util.function.Function; - -import org.springframework.util.Assert; - -/** - * Factory to create a {@link CompositeReactiveHealthIndicator}. - * - * @author Stephane Nicoll - * @since 2.0.0 - * @deprecated since 2.1.0 in favor of - * {@link CompositeReactiveHealthIndicator#CompositeReactiveHealthIndicator(HealthAggregator, ReactiveHealthIndicatorRegistry)} - */ -@Deprecated -public class CompositeReactiveHealthIndicatorFactory { - - private final Function healthIndicatorNameFactory; - - public CompositeReactiveHealthIndicatorFactory( - Function healthIndicatorNameFactory) { - this.healthIndicatorNameFactory = healthIndicatorNameFactory; - } - - public CompositeReactiveHealthIndicatorFactory() { - this(new HealthIndicatorNameFactory()); - } - - /** - * Create a {@link CompositeReactiveHealthIndicator} based on the specified health - * indicators. Each {@link HealthIndicator} are wrapped to a - * {@link HealthIndicatorReactiveAdapter}. If two instances share the same name, the - * reactive variant takes precedence. - * @param healthAggregator the {@link HealthAggregator} - * @param reactiveHealthIndicators the {@link ReactiveHealthIndicator} instances - * mapped by name - * @param healthIndicators the {@link HealthIndicator} instances mapped by name if - * any. - * @return a {@link ReactiveHealthIndicator} that delegates to the specified - * {@code reactiveHealthIndicators}. - */ - public CompositeReactiveHealthIndicator createReactiveHealthIndicator( - HealthAggregator healthAggregator, - Map reactiveHealthIndicators, - Map healthIndicators) { - Assert.notNull(healthAggregator, "HealthAggregator must not be null"); - Assert.notNull(reactiveHealthIndicators, - "ReactiveHealthIndicators must not be null"); - ReactiveHealthIndicatorRegistryFactory factory = new ReactiveHealthIndicatorRegistryFactory( - this.healthIndicatorNameFactory); - return new CompositeReactiveHealthIndicator(healthAggregator, - factory.createReactiveHealthIndicatorRegistry(reactiveHealthIndicators, - healthIndicators)); - } - -} diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java index 39e15483f9..a2b3611196 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java index f97d2c9859..cb81a669e1 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ import io.micrometer.core.instrument.Timer; import io.micrometer.core.instrument.Timer.Builder; import io.micrometer.core.instrument.Timer.Sample; -import org.springframework.context.ApplicationContext; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.http.HttpStatus; import org.springframework.web.filter.OncePerRequestFilter; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/system/DiskSpaceHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/system/DiskSpaceHealthIndicator.java index 12cb6eca07..e3fc8e6a29 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/system/DiskSpaceHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/system/DiskSpaceHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicatorFactoryTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicatorFactoryTests.java deleted file mode 100644 index 09f616c36b..0000000000 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicatorFactoryTests.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2012-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.actuate.health; - -import java.util.Collections; -import java.util.Map; - -import org.junit.Test; -import reactor.core.publisher.Mono; -import reactor.test.StepVerifier; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.BDDMockito.given; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -/** - * Tests for {@link CompositeReactiveHealthIndicatorFactory}. - * - * @author Stephane Nicoll - */ -@Deprecated -public class CompositeReactiveHealthIndicatorFactoryTests { - - private static final Health UP = new Health.Builder().status(Status.UP).build(); - - private static final Health DOWN = new Health.Builder().status(Status.DOWN).build(); - - @Test - public void noHealthIndicator() { - ReactiveHealthIndicator healthIndicator = createHealthIndicator( - Collections.singletonMap("test", () -> Mono.just(UP)), null); - StepVerifier.create(healthIndicator.health()).consumeNextWith((h) -> { - assertThat(h.getStatus()).isEqualTo(Status.UP); - assertThat(h.getDetails()).containsOnlyKeys("test"); - }).verifyComplete(); - } - - @Test - public void defaultHealthIndicatorNameFactory() { - ReactiveHealthIndicator healthIndicator = new CompositeReactiveHealthIndicatorFactory() - .createReactiveHealthIndicator(new OrderedHealthAggregator(), Collections - .singletonMap("myHealthIndicator", () -> Mono.just(UP)), null); - StepVerifier.create(healthIndicator.health()).consumeNextWith((h) -> { - assertThat(h.getStatus()).isEqualTo(Status.UP); - assertThat(h.getDetails()).containsOnlyKeys("my"); - }).verifyComplete(); - } - - @Test - public void healthIndicatorIsAdapted() { - ReactiveHealthIndicator healthIndicator = createHealthIndicator( - Collections.singletonMap("test", () -> Mono.just(UP)), - Collections.singletonMap("regular", () -> DOWN)); - StepVerifier.create(healthIndicator.health()).consumeNextWith((h) -> { - assertThat(h.getStatus()).isEqualTo(Status.DOWN); - assertThat(h.getDetails()).containsOnlyKeys("test", "regular"); - }).verifyComplete(); - } - - @Test - public void reactiveHealthIndicatorTakesPrecedence() { - ReactiveHealthIndicator reactiveHealthIndicator = mock( - ReactiveHealthIndicator.class); - given(reactiveHealthIndicator.health()).willReturn(Mono.just(UP)); - HealthIndicator regularHealthIndicator = mock(HealthIndicator.class); - given(regularHealthIndicator.health()).willReturn(UP); - ReactiveHealthIndicator healthIndicator = createHealthIndicator( - Collections.singletonMap("test", reactiveHealthIndicator), - Collections.singletonMap("test", regularHealthIndicator)); - StepVerifier.create(healthIndicator.health()).consumeNextWith((h) -> { - assertThat(h.getStatus()).isEqualTo(Status.UP); - assertThat(h.getDetails()).containsOnlyKeys("test"); - }).verifyComplete(); - verify(reactiveHealthIndicator, times(1)).health(); - verify(regularHealthIndicator, never()).health(); - } - - private ReactiveHealthIndicator createHealthIndicator( - Map reactiveHealthIndicators, - Map healthIndicators) { - return new CompositeReactiveHealthIndicatorFactory((n) -> n) - .createReactiveHealthIndicator(new OrderedHealthAggregator(), - reactiveHealthIndicators, healthIndicators); - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java index becc1374de..ffa3a69dc7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ import java.util.List; import org.springframework.amqp.core.AcknowledgeMode; import org.springframework.amqp.rabbit.connection.CachingConnectionFactory.CacheMode; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; import org.springframework.boot.convert.DurationUnit; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; @@ -831,17 +830,6 @@ public class RabbitProperties { this.defaultReceiveQueue = defaultReceiveQueue; } - @Deprecated - @DeprecatedConfigurationProperty(replacement = "spring.rabbitmq.template.default-receive-queue") - public String getQueue() { - return getDefaultReceiveQueue(); - } - - @Deprecated - public void setQueue(String queue) { - setDefaultReceiveQueue(queue); - } - } public static class Retry { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunner.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunner.java index 5d73490cce..14374301c2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunner.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.java index 6142bcd5a2..b54f32c4e6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.java @@ -23,7 +23,6 @@ import com.datastax.driver.core.PoolingOptions; import com.datastax.driver.core.QueryOptions; import com.datastax.driver.core.SocketOptions; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -60,14 +59,8 @@ public class CassandraAutoConfiguration { map.from(properties::getUsername).whenNonNull().to((username) -> builder .withCredentials(username, properties.getPassword())); map.from(properties::getCompression).whenNonNull().to(builder::withCompression); - map.from(properties::getLoadBalancingPolicy).whenNonNull() - .as(BeanUtils::instantiateClass).to(builder::withLoadBalancingPolicy); QueryOptions queryOptions = getQueryOptions(properties); map.from(queryOptions).to(builder::withQueryOptions); - map.from(properties::getReconnectionPolicy).whenNonNull() - .as(BeanUtils::instantiateClass).to(builder::withReconnectionPolicy); - map.from(properties::getRetryPolicy).whenNonNull().as(BeanUtils::instantiateClass) - .to(builder::withRetryPolicy); SocketOptions socketOptions = getSocketOptions(properties); map.from(socketOptions).to(builder::withSocketOptions); map.from(properties::isSsl).whenTrue().toCall(builder::withSSL); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java index 21335a9cfa..951a82650c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,12 +26,8 @@ import com.datastax.driver.core.ConsistencyLevel; import com.datastax.driver.core.ProtocolOptions; import com.datastax.driver.core.ProtocolOptions.Compression; import com.datastax.driver.core.QueryOptions; -import com.datastax.driver.core.policies.LoadBalancingPolicy; -import com.datastax.driver.core.policies.ReconnectionPolicy; -import com.datastax.driver.core.policies.RetryPolicy; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; import org.springframework.boot.convert.DurationUnit; /** @@ -82,11 +78,6 @@ public class CassandraProperties { */ private Compression compression = Compression.NONE; - /** - * Class name of the load balancing policy. The class must have a default constructor. - */ - private Class loadBalancingPolicy; - /** * Queries consistency level. */ @@ -102,16 +93,6 @@ public class CassandraProperties { */ private int fetchSize = QueryOptions.DEFAULT_FETCH_SIZE; - /** - * Class name of the reconnection policy. The class must have a default constructor. - */ - private Class reconnectionPolicy; - - /** - * Class name of the retry policy. The class must have a default constructor. - */ - private Class retryPolicy; - /** * Socket option: connection time out. */ @@ -195,18 +176,6 @@ public class CassandraProperties { this.compression = compression; } - @DeprecatedConfigurationProperty(reason = "Implement a ClusterBuilderCustomizer bean instead.") - @Deprecated - public Class getLoadBalancingPolicy() { - return this.loadBalancingPolicy; - } - - @Deprecated - public void setLoadBalancingPolicy( - Class loadBalancingPolicy) { - this.loadBalancingPolicy = loadBalancingPolicy; - } - public ConsistencyLevel getConsistencyLevel() { return this.consistencyLevel; } @@ -231,29 +200,6 @@ public class CassandraProperties { this.fetchSize = fetchSize; } - @DeprecatedConfigurationProperty(reason = "Implement a ClusterBuilderCustomizer bean instead.") - @Deprecated - public Class getReconnectionPolicy() { - return this.reconnectionPolicy; - } - - @Deprecated - public void setReconnectionPolicy( - Class reconnectionPolicy) { - this.reconnectionPolicy = reconnectionPolicy; - } - - @DeprecatedConfigurationProperty(reason = "Implement a ClusterBuilderCustomizer bean instead.") - @Deprecated - public Class getRetryPolicy() { - return this.retryPolicy; - } - - @Deprecated - public void setRetryPolicy(Class retryPolicy) { - this.retryPolicy = retryPolicy; - } - public Duration getConnectTimeout() { return this.connectTimeout; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfiguration.java index 2a1e75feaa..e4aeb5909d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfiguration.java @@ -17,8 +17,6 @@ package org.springframework.boot.autoconfigure.influx; import okhttp3.OkHttpClient; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.influxdb.InfluxDB; import org.influxdb.impl.InfluxDBImpl; @@ -44,33 +42,20 @@ import org.springframework.context.annotation.Configuration; @EnableConfigurationProperties(InfluxDbProperties.class) public class InfluxDbAutoConfiguration { - private static final Log logger = LogFactory.getLog(InfluxDbAutoConfiguration.class); - @Bean @ConditionalOnMissingBean @ConditionalOnProperty("spring.influx.url") public InfluxDB influxDb(InfluxDbProperties properties, - ObjectProvider builder, - ObjectProvider deprecatedBuilder) { + ObjectProvider builder) { return new InfluxDBImpl(properties.getUrl(), properties.getUser(), - properties.getPassword(), determineBuilder(builder.getIfAvailable(), - deprecatedBuilder.getIfAvailable())); + properties.getPassword(), determineBuilder(builder.getIfAvailable())); } - @Deprecated private static OkHttpClient.Builder determineBuilder( - InfluxDbOkHttpClientBuilderProvider builder, - OkHttpClient.Builder deprecatedBuilder) { + InfluxDbOkHttpClientBuilderProvider builder) { if (builder != null) { return builder.get(); } - else if (deprecatedBuilder != null) { - logger.warn( - "InfluxDB client customizations using a OkHttpClient.Builder is deprecated, register a " - + InfluxDbOkHttpClientBuilderProvider.class.getSimpleName() - + " bean instead"); - return deprecatedBuilder; - } return new OkHttpClient.Builder(); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsPoolConnectionFactoryProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsPoolConnectionFactoryProperties.java index 427b67d073..1876dd4f19 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsPoolConnectionFactoryProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsPoolConnectionFactoryProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -110,17 +110,6 @@ public class JmsPoolConnectionFactoryProperties { this.maxConnections = maxConnections; } - @Deprecated - public int getMaximumActiveSessionPerConnection() { - return getMaxSessionsPerConnection(); - } - - @Deprecated - public void setMaximumActiveSessionPerConnection( - int maximumActiveSessionPerConnection) { - setMaxSessionsPerConnection(maximumActiveSessionPerConnection); - } - public int getMaxSessionsPerConnection() { return this.maxSessionsPerConnection; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java index 1f42906894..f0e2eeeb9a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ import org.apache.kafka.common.serialization.StringDeserializer; import org.apache.kafka.common.serialization.StringSerializer; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.convert.DurationUnit; import org.springframework.core.io.Resource; @@ -729,20 +728,6 @@ public class KafkaProperties { this.bootstrapServers = bootstrapServers; } - @DeprecatedConfigurationProperty(replacement = "spring.kafka.streams.cache-max-size-buffering") - @Deprecated - public Integer getCacheMaxBytesBuffering() { - return (this.cacheMaxSizeBuffering != null) - ? (int) this.cacheMaxSizeBuffering.toBytes() : null; - } - - @Deprecated - public void setCacheMaxBytesBuffering(Integer cacheMaxBytesBuffering) { - DataSize cacheMaxSizeBuffering = (cacheMaxBytesBuffering != null) - ? DataSize.ofBytes(cacheMaxBytesBuffering) : null; - setCacheMaxSizeBuffering(cacheMaxSizeBuffering); - } - public DataSize getCacheMaxSizeBuffering() { return this.cacheMaxSizeBuffering; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientProperties.java index 3d671ee3bc..6079d9bcfc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -161,16 +161,6 @@ public class OAuth2ClientProperties { this.redirectUri = redirectUri; } - @Deprecated - public String getRedirectUriTemplate() { - return getRedirectUri(); - } - - @Deprecated - public void setRedirectUriTemplate(String redirectUri) { - setRedirectUri(redirectUri); - } - public Set getScope() { return this.scope; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index b667911e2c..86d9814c75 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -30,7 +30,6 @@ import java.util.Map; import java.util.TimeZone; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.boot.convert.DurationUnit; import org.springframework.boot.web.server.Compression; @@ -330,11 +329,6 @@ public class ServerProperties { */ private DataSize maxHttpPostSize = DataSize.ofMegabytes(2); - /** - * Maximum size of the HTTP message header. - */ - private DataSize maxHttpHeaderSize = DataSize.ofBytes(0); - /** * Maximum amount of request body to swallow. */ @@ -504,17 +498,6 @@ public class ServerProperties { this.maxConnections = maxConnections; } - @Deprecated - @DeprecatedConfigurationProperty(replacement = "server.max-http-header-size") - public DataSize getMaxHttpHeaderSize() { - return this.maxHttpHeaderSize; - } - - @Deprecated - public void setMaxHttpHeaderSize(DataSize maxHttpHeaderSize) { - this.maxHttpHeaderSize = maxHttpHeaderSize; - } - public DataSize getMaxSwallowSize() { return this.maxSwallowSize; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java index 3bfc2590e7..86e3995f48 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java @@ -85,7 +85,7 @@ public class TomcatWebServerFactoryCustomizer implements tomcatProperties.getMaxThreads())); propertyMapper.from(tomcatProperties::getMinSpareThreads).when(this::isPositive) .to((minSpareThreads) -> customizeMinThreads(factory, minSpareThreads)); - propertyMapper.from(this::determineMaxHttpHeaderSize).whenNonNull() + propertyMapper.from(this.serverProperties.getMaxHttpHeaderSize()).whenNonNull() .asInt(DataSize::toBytes).when(this::isPositive) .to((maxHttpHeaderSize) -> customizeMaxHttpHeaderSize(factory, maxHttpHeaderSize)); @@ -118,13 +118,6 @@ public class TomcatWebServerFactoryCustomizer implements return value > 0; } - @SuppressWarnings("deprecation") - private DataSize determineMaxHttpHeaderSize() { - return (this.serverProperties.getTomcat().getMaxHttpHeaderSize().toBytes() > 0) - ? this.serverProperties.getTomcat().getMaxHttpHeaderSize() - : this.serverProperties.getMaxHttpHeaderSize(); - } - private void customizeAcceptCount(ConfigurableTomcatWebServerFactory factory, int acceptCount) { factory.addConnectorCustomizers((connector) -> { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java index ef276edd5d..50d3c66a2e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -325,18 +325,6 @@ public class RabbitAutoConfigurationTests { }); } - @Test - @Deprecated - public void testRabbitTemplateDefaultQueue() { - this.contextRunner.withUserConfiguration(TestConfiguration.class) - .withPropertyValues("spring.rabbitmq.template.queue:default-queue") - .run((context) -> { - RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class); - assertThat(rabbitTemplate).hasFieldOrPropertyWithValue( - "defaultReceiveQueue", "default-queue"); - }); - } - @Test public void testRabbitTemplateMandatory() { this.contextRunner.withUserConfiguration(TestConfiguration.class) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfigurationTests.java index 088097d6b8..52775d8f68 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,35 +87,6 @@ public class InfluxDbAutoConfigurationTests { }); } - @Test - public void influxDbWithOkHttpClientBuilderProviderIgnoreOkHttpClientBuilder() { - this.contextRunner - .withUserConfiguration(CustomOkHttpClientBuilderConfig.class, - CustomOkHttpClientBuilderProviderConfig.class) - .withPropertyValues("spring.influx.url=http://localhost") - .run((context) -> { - assertThat(context.getBeansOfType(InfluxDB.class)).hasSize(1); - int readTimeout = getReadTimeoutProperty(context); - assertThat(readTimeout).isEqualTo(40_000); - assertThat(this.output.toString()).doesNotContain( - "InfluxDB client customizations using a OkHttpClient.Builder is deprecated"); - }); - } - - @Test - @Deprecated - public void influxDbWithOkHttpClientBuilder() { - this.contextRunner.withUserConfiguration(CustomOkHttpClientBuilderConfig.class) - .withPropertyValues("spring.influx.url=http://localhost") - .run((context) -> { - assertThat(context.getBeansOfType(InfluxDB.class)).hasSize(1); - int readTimeout = getReadTimeoutProperty(context); - assertThat(readTimeout).isEqualTo(30_000); - assertThat(this.output.toString()).contains( - "InfluxDB client customizations using a OkHttpClient.Builder is deprecated"); - }); - } - private int getReadTimeoutProperty(AssertableApplicationContext context) { InfluxDB influxDB = context.getBean(InfluxDB.class); Retrofit retrofit = (Retrofit) ReflectionTestUtils.getField(influxDB, "retrofit"); @@ -133,14 +104,4 @@ public class InfluxDbAutoConfigurationTests { } - @Configuration - static class CustomOkHttpClientBuilderConfig { - - @Bean - public OkHttpClient.Builder builder() { - return new OkHttpClient.Builder().readTimeout(30, TimeUnit.SECONDS); - } - - } - } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java index 217a7748a4..cbf4907462 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -217,22 +217,6 @@ public class ActiveMQAutoConfigurationTests { }); } - @Test - @Deprecated - public void customPoolConnectionFactoryIsAppliedWithDeprecatedSettings() { - this.contextRunner.withUserConfiguration(EmptyConfiguration.class) - .withPropertyValues("spring.activemq.pool.enabled=true", - "spring.activemq.pool.maximumActiveSessionPerConnection=1024") - .run((context) -> { - assertThat(context.getBeansOfType(JmsPoolConnectionFactory.class)) - .hasSize(1); - JmsPoolConnectionFactory connectionFactory = context - .getBean(JmsPoolConnectionFactory.class); - assertThat(connectionFactory.getMaxSessionsPerConnection()) - .isEqualTo(1024); - }); - } - @Test public void poolConnectionFactoryConfiguration() { this.contextRunner.withUserConfiguration(EmptyConfiguration.class) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java index 79b4ee964c..0610429d65 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java @@ -401,21 +401,6 @@ public class ArtemisAutoConfigurationTests { }); } - @Test - public void customPoolConnectionFactoryIsAppliedWithDeprecatedSettings() { - this.contextRunner - .withPropertyValues("spring.artemis.pool.enabled=true", - "spring.artemis.pool.maximumActiveSessionPerConnection=1024") - .run((context) -> { - assertThat(context.getBeansOfType(JmsPoolConnectionFactory.class)) - .hasSize(1); - JmsPoolConnectionFactory connectionFactory = context - .getBean(JmsPoolConnectionFactory.class); - assertThat(connectionFactory.getMaxSessionsPerConnection()) - .isEqualTo(1024); - }); - } - @Test public void poolConnectionFactoryConfiguration() { this.contextRunner.withPropertyValues("spring.artemis.pool.enabled:true") diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java index 53dcd1f0c8..96ff42dd96 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java @@ -351,22 +351,6 @@ public class KafkaAutoConfigurationTests { }); } - @Test - @Deprecated - public void streamPropertiesWithCustomCacheMaxBytesBuffering() { - this.contextRunner.withUserConfiguration(EnableKafkaStreamsConfiguration.class) - .withPropertyValues("spring.application.name=appName", - "spring.kafka.streams.cache-max-bytes-buffering=42") - .run((context) -> { - Properties configs = context.getBean( - KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_CONFIG_BEAN_NAME, - KafkaStreamsConfiguration.class).asProperties(); - assertThat( - configs.get(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG)) - .isEqualTo("42"); - }); - } - @Test public void streamsApplicationIdUsesMainApplicationNameByDefault() { this.contextRunner.withUserConfiguration(EnableKafkaStreamsConfiguration.class) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java index f669434abf..4ee283c3cd 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java @@ -145,16 +145,6 @@ public class TomcatWebServerFactoryCustomizerTests { .isEqualTo(DataSize.ofKilobytes(8).toBytes())); } - @Test - @Deprecated - public void customMaxHttpHeaderSizeWithDeprecatedProperty() { - bind("server.max-http-header-size=4KB", - "server.tomcat.max-http-header-size=1024"); - customizeAndRunServer((server) -> assertThat(((AbstractHttp11Protocol) server - .getTomcat().getConnector().getProtocolHandler()).getMaxHttpHeaderSize()) - .isEqualTo(DataSize.ofKilobytes(1).toBytes())); - } - @Test public void customMaxSwallowSize() { bind("server.tomcat.max-swallow-size=10MB"); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java index d01e74321b..3f745b98ce 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java index 4f521a8ca8..e955a3f190 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java index ded42c7a7f..52574afa24 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/MultipartConfigFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/MultipartConfigFactory.java index a45dad67f7..3d80d5a87c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/MultipartConfigFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/MultipartConfigFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java index 54e5d146c3..c396ff8dd5 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java @@ -544,24 +544,6 @@ public class RestTemplateBuilderTests { .isInstanceOf(BufferingClientHttpRequestFactory.class); } - @Test - @SuppressWarnings("deprecation") - public void connectTimeoutCanBeSetWithInteger() { - ClientHttpRequestFactory requestFactory = this.builder - .requestFactory(SimpleClientHttpRequestFactory.class) - .setConnectTimeout(Duration.ofMillis(1234)).build().getRequestFactory(); - assertThat(requestFactory).hasFieldOrPropertyWithValue("connectTimeout", 1234); - } - - @Test - @SuppressWarnings("deprecation") - public void readTimeoutCanBeSetWithInteger() { - ClientHttpRequestFactory requestFactory = this.builder - .requestFactory(SimpleClientHttpRequestFactory.class).setReadTimeout(Duration.ofMillis(1234)) - .build().getRequestFactory(); - assertThat(requestFactory).hasFieldOrPropertyWithValue("readTimeout", 1234); - } - public static class RestTemplateSubclass extends RestTemplate { } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MultipartConfigFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MultipartConfigFactoryTests.java index ba1654a34b..fa72fd6ebe 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MultipartConfigFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MultipartConfigFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.