Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
715db153
Commit
715db153
authored
Feb 27, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Remove code deprecated in 2.1"
Closes gh-16013
parent
246111cd
Changes
40
Show whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
88 additions
and
643 deletions
+88
-643
DefaultEndpointObjectNameFactory.java
...figure/endpoint/jmx/DefaultEndpointObjectNameFactory.java
+3
-18
JmxEndpointProperties.java
...ate/autoconfigure/endpoint/jmx/JmxEndpointProperties.java
+1
-18
JvmMetricsAutoConfiguration.java
...te/autoconfigure/metrics/JvmMetricsAutoConfiguration.java
+1
-3
LogbackMetricsAutoConfiguration.java
...utoconfigure/metrics/LogbackMetricsAutoConfiguration.java
+1
-3
SystemMetricsAutoConfiguration.java
...autoconfigure/metrics/SystemMetricsAutoConfiguration.java
+1
-5
additional-spring-configuration-metadata.json
...es/META-INF/additional-spring-configuration-metadata.json
+53
-48
DefaultEndpointObjectNameFactoryTests.java
...e/endpoint/jmx/DefaultEndpointObjectNameFactoryTests.java
+1
-20
JvmMetricsAutoConfigurationTests.java
...toconfigure/metrics/JvmMetricsAutoConfigurationTests.java
+1
-12
LogbackMetricsAutoConfigurationTests.java
...nfigure/metrics/LogbackMetricsAutoConfigurationTests.java
+1
-10
SystemMetricsAutoConfigurationTests.java
...onfigure/metrics/SystemMetricsAutoConfigurationTests.java
+1
-28
PathMapper.java
...springframework/boot/actuate/endpoint/web/PathMapper.java
+1
-1
CompositeHealthIndicator.java
...amework/boot/actuate/health/CompositeHealthIndicator.java
+1
-1
CompositeReactiveHealthIndicator.java
...boot/actuate/health/CompositeReactiveHealthIndicator.java
+1
-4
CompositeReactiveHealthIndicatorFactory.java
...tuate/health/CompositeReactiveHealthIndicatorFactory.java
+0
-73
MetricsWebFilter.java
...actuate/metrics/web/reactive/server/MetricsWebFilter.java
+1
-1
WebMvcMetricsFilter.java
...boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java
+1
-2
DiskSpaceHealthIndicator.java
...amework/boot/actuate/system/DiskSpaceHealthIndicator.java
+1
-1
CompositeReactiveHealthIndicatorFactoryTests.java
.../health/CompositeReactiveHealthIndicatorFactoryTests.java
+0
-103
RabbitProperties.java
...ngframework/boot/autoconfigure/amqp/RabbitProperties.java
+1
-13
JobLauncherCommandLineRunner.java
...oot/autoconfigure/batch/JobLauncherCommandLineRunner.java
+1
-1
CassandraAutoConfiguration.java
...t/autoconfigure/cassandra/CassandraAutoConfiguration.java
+0
-7
CassandraProperties.java
...ork/boot/autoconfigure/cassandra/CassandraProperties.java
+1
-55
InfluxDbAutoConfiguration.java
.../boot/autoconfigure/influx/InfluxDbAutoConfiguration.java
+3
-18
JmsPoolConnectionFactoryProperties.java
...autoconfigure/jms/JmsPoolConnectionFactoryProperties.java
+1
-12
KafkaProperties.java
...ngframework/boot/autoconfigure/kafka/KafkaProperties.java
+1
-16
OAuth2ClientProperties.java
...figure/security/oauth2/client/OAuth2ClientProperties.java
+1
-11
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+0
-17
TomcatWebServerFactoryCustomizer.java
...figure/web/embedded/TomcatWebServerFactoryCustomizer.java
+1
-8
RabbitAutoConfigurationTests.java
...boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java
+1
-13
InfluxDbAutoConfigurationTests.java
.../autoconfigure/influx/InfluxDbAutoConfigurationTests.java
+1
-40
ActiveMQAutoConfigurationTests.java
...onfigure/jms/activemq/ActiveMQAutoConfigurationTests.java
+1
-17
ArtemisAutoConfigurationTests.java
...oconfigure/jms/artemis/ArtemisAutoConfigurationTests.java
+0
-15
KafkaAutoConfigurationTests.java
...boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java
+0
-16
TomcatWebServerFactoryCustomizerTests.java
...e/web/embedded/TomcatWebServerFactoryCustomizerTests.java
+0
-10
RestTemplateBuilder.java
.../springframework/boot/web/client/RestTemplateBuilder.java
+1
-1
AbstractFilterRegistrationBean.java
...work/boot/web/servlet/AbstractFilterRegistrationBean.java
+1
-1
FilterRegistrationBean.java
...ingframework/boot/web/servlet/FilterRegistrationBean.java
+1
-1
MultipartConfigFactory.java
...ingframework/boot/web/servlet/MultipartConfigFactory.java
+1
-1
RestTemplateBuilderTests.java
...ngframework/boot/web/client/RestTemplateBuilderTests.java
+0
-18
MultipartConfigFactoryTests.java
...amework/boot/web/servlet/MultipartConfigFactoryTests.java
+1
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactory.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointProperties.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
;
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/JvmMetricsAutoConfiguration.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/LogbackMetricsAutoConfiguration.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/SystemMetricsAutoConfiguration.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
();
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
View file @
715db153
...
...
@@ -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"
,
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/DefaultEndpointObjectNameFactoryTests.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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"
);
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/JvmMetricsAutoConfigurationTests.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
)
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/LogbackMetricsAutoConfigurationTests.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
)
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/SystemMetricsAutoConfigurationTests.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMapper.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthIndicator.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
<
Health
>,
Mono
<
Health
>>
timeoutCompose
;
/**
* Create a new {@link CompositeReactiveHealthIndicator} from the indicators in the
* given {@code registry}.
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicatorFactory.java
deleted
100644 → 0
View file @
246111cd
/*
* 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
<
String
,
String
>
healthIndicatorNameFactory
;
public
CompositeReactiveHealthIndicatorFactory
(
Function
<
String
,
String
>
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
<
String
,
ReactiveHealthIndicator
>
reactiveHealthIndicators
,
Map
<
String
,
HealthIndicator
>
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
));
}
}
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
;
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/system/DiskSpaceHealthIndicator.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicatorFactoryTests.java
deleted
100644 → 0
View file @
246111cd
/*
* 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
<
String
,
ReactiveHealthIndicator
>
reactiveHealthIndicators
,
Map
<
String
,
HealthIndicator
>
healthIndicators
)
{
return
new
CompositeReactiveHealthIndicatorFactory
((
n
)
->
n
)
.
createReactiveHealthIndicator
(
new
OrderedHealthAggregator
(),
reactiveHealthIndicators
,
healthIndicators
);
}
}
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunner.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.java
View file @
715db153
...
...
@@ -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
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
<?
extends
LoadBalancingPolicy
>
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
<?
extends
ReconnectionPolicy
>
reconnectionPolicy
;
/**
* Class name of the retry policy. The class must have a default constructor.
*/
private
Class
<?
extends
RetryPolicy
>
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
<?
extends
LoadBalancingPolicy
>
getLoadBalancingPolicy
()
{
return
this
.
loadBalancingPolicy
;
}
@Deprecated
public
void
setLoadBalancingPolicy
(
Class
<?
extends
LoadBalancingPolicy
>
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
<?
extends
ReconnectionPolicy
>
getReconnectionPolicy
()
{
return
this
.
reconnectionPolicy
;
}
@Deprecated
public
void
setReconnectionPolicy
(
Class
<?
extends
ReconnectionPolicy
>
reconnectionPolicy
)
{
this
.
reconnectionPolicy
=
reconnectionPolicy
;
}
@DeprecatedConfigurationProperty
(
reason
=
"Implement a ClusterBuilderCustomizer bean instead."
)
@Deprecated
public
Class
<?
extends
RetryPolicy
>
getRetryPolicy
()
{
return
this
.
retryPolicy
;
}
@Deprecated
public
void
setRetryPolicy
(
Class
<?
extends
RetryPolicy
>
retryPolicy
)
{
this
.
retryPolicy
=
retryPolicy
;
}
public
Duration
getConnectTimeout
()
{
return
this
.
connectTimeout
;
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfiguration.java
View file @
715db153
...
...
@@ -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
<
InfluxDbOkHttpClientBuilderProvider
>
builder
,
ObjectProvider
<
OkHttpClient
.
Builder
>
deprecatedBuilder
)
{
ObjectProvider
<
InfluxDbOkHttpClientBuilderProvider
>
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
();
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsPoolConnectionFactoryProperties.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
;
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
;
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientProperties.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
<
String
>
getScope
()
{
return
this
.
scope
;
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
715db153
...
...
@@ -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
;
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java
View file @
715db153
...
...
@@ -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
)
->
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/influx/InfluxDbAutoConfigurationTests.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
);
}
}
}
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java
View file @
715db153
...
...
@@ -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"
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java
View file @
715db153
...
...
@@ -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
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java
View file @
715db153
...
...
@@ -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"
);
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/FilterRegistrationBean.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/MultipartConfigFactory.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java
View file @
715db153
...
...
@@ -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
{
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/MultipartConfigFactoryTests.java
View file @
715db153
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment