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
1e44aba7
Commit
1e44aba7
authored
Apr 24, 2019
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compiler warnings and polish
Fix various compiler warnings and apply a little polish.
parent
47543863
Changes
61
Hide whitespace changes
Inline
Side-by-side
Showing
61 changed files
with
212 additions
and
125 deletions
+212
-125
ElasticSearchClientHealthIndicatorAutoConfiguration.java
.../ElasticSearchClientHealthIndicatorAutoConfiguration.java
+3
-0
ElasticSearchJestHealthIndicatorAutoConfiguration.java
...ch/ElasticSearchJestHealthIndicatorAutoConfiguration.java
+1
-0
ElasticSearchRestHealthIndicatorAutoConfiguration.java
...ch/ElasticSearchRestHealthIndicatorAutoConfiguration.java
+1
-0
ElasticsearchHealthIndicatorProperties.java
...elasticsearch/ElasticsearchHealthIndicatorProperties.java
+8
-0
ElasticsearchHealthIndicatorAutoConfigurationTests.java
...h/ElasticsearchHealthIndicatorAutoConfigurationTests.java
+1
-0
WebEndpointsAutoConfigurationIntegrationTests.java
...ontest/WebEndpointsAutoConfigurationIntegrationTests.java
+5
-5
MeterRegistryConfigurerIntegrationTests.java
...gure/metrics/MeterRegistryConfigurerIntegrationTests.java
+0
-1
ElasticsearchHealthIndicator.java
...t/actuate/elasticsearch/ElasticsearchHealthIndicator.java
+2
-1
ElasticsearchHealthIndicatorTests.java
...uate/elasticsearch/ElasticsearchHealthIndicatorTests.java
+1
-0
BaseConfiguration.java
...ot/actuate/endpoint/web/annotation/BaseConfiguration.java
+3
-3
AbstractRepositoryConfigurationSourceSupport.java
...re/data/AbstractRepositoryConfigurationSourceSupport.java
+37
-21
CassandraReactiveRepositoriesAutoConfiguration.java
...andra/CassandraReactiveRepositoriesAutoConfiguration.java
+1
-1
CassandraReactiveRepositoriesRegistrar.java
...ata/cassandra/CassandraReactiveRepositoriesRegistrar.java
+2
-2
CassandraRepositoriesAutoConfiguration.java
...ata/cassandra/CassandraRepositoriesAutoConfiguration.java
+1
-1
CassandraRepositoriesRegistrar.java
...figure/data/cassandra/CassandraRepositoriesRegistrar.java
+2
-2
ElasticsearchDataAutoConfiguration.java
...ata/elasticsearch/ElasticsearchDataAutoConfiguration.java
+1
-0
JdbcRepositoriesAutoConfiguration.java
...onfigure/data/jdbc/JdbcRepositoriesAutoConfiguration.java
+1
-1
JdbcRepositoriesRegistrar.java
...ot/autoconfigure/data/jdbc/JdbcRepositoriesRegistrar.java
+2
-2
JpaRepositoriesAutoConfiguration.java
...oconfigure/data/jpa/JpaRepositoriesAutoConfiguration.java
+1
-1
JpaRepositoriesRegistrar.java
...boot/autoconfigure/data/jpa/JpaRepositoriesRegistrar.java
+2
-2
MongoReactiveRepositoriesAutoConfiguration.java
...ata/mongo/MongoReactiveRepositoriesAutoConfiguration.java
+1
-1
MongoReactiveRepositoriesRegistrar.java
...figure/data/mongo/MongoReactiveRepositoriesRegistrar.java
+2
-2
MongoRepositoriesAutoConfiguration.java
...figure/data/mongo/MongoRepositoriesAutoConfiguration.java
+1
-1
MongoRepositoriesRegistrar.java
.../autoconfigure/data/mongo/MongoRepositoriesRegistrar.java
+2
-2
Neo4jRepositoriesAutoConfiguration.java
...figure/data/neo4j/Neo4jRepositoriesAutoConfiguration.java
+1
-1
Neo4jRepositoriesRegistrar.java
.../autoconfigure/data/neo4j/Neo4jRepositoriesRegistrar.java
+2
-2
RedisRepositoriesAutoConfiguration.java
...figure/data/redis/RedisRepositoriesAutoConfiguration.java
+1
-1
RedisRepositoriesRegistrar.java
.../autoconfigure/data/redis/RedisRepositoriesRegistrar.java
+2
-2
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+7
-12
ElasticsearchAutoConfigurationTests.java
...ta/elasticsearch/ElasticsearchAutoConfigurationTests.java
+1
-0
ElasticsearchDataAutoConfigurationTests.java
...lasticsearch/ElasticsearchDataAutoConfigurationTests.java
+2
-1
JestAutoConfigurationTests.java
...figure/elasticsearch/jest/JestAutoConfigurationTests.java
+1
-0
RestClientAutoConfigurationTests.java
.../elasticsearch/rest/RestClientAutoConfigurationTests.java
+3
-3
MongoClientFactoryTests.java
...ork/boot/autoconfigure/mongo/MongoClientFactoryTests.java
+22
-11
MongoPropertiesTests.java
...mework/boot/autoconfigure/mongo/MongoPropertiesTests.java
+11
-4
EmbeddedMongoAutoConfigurationTests.java
...e/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java
+10
-3
JpaPropertiesTests.java
...mework/boot/autoconfigure/orm/jpa/JpaPropertiesTests.java
+8
-0
ReactiveWebServerFactoryAutoConfigurationTests.java
...ctive/ReactiveWebServerFactoryAutoConfigurationTests.java
+1
-1
ServletWebServerFactoryAutoConfigurationTests.java
...ervlet/ServletWebServerFactoryAutoConfigurationTests.java
+1
-1
JsonTestersAutoConfiguration.java
...test/autoconfigure/json/JsonTestersAutoConfiguration.java
+3
-0
ImportsContextCustomizer.java
...framework/boot/test/context/ImportsContextCustomizer.java
+0
-1
ApplicationContextAssertProvider.java
...est/context/assertj/ApplicationContextAssertProvider.java
+3
-2
JsonContent.java
.../java/org/springframework/boot/test/json/JsonContent.java
+3
-3
TestRestTemplateContextCustomizerWithFactoryBeanTests.java
...estRestTemplateContextCustomizerWithFactoryBeanTests.java
+3
-0
SimpleFactoryBean.java
...ramework/boot/test/web/client/scan/SimpleFactoryBean.java
+6
-0
JavaBeanPropertyDescriptorTests.java
...nfigurationprocessor/JavaBeanPropertyDescriptorTests.java
+9
-9
LombokPropertyDescriptorTests.java
...configurationprocessor/LombokPropertyDescriptorTests.java
+9
-9
UpperBoundGenericPojo.java
...ot/configurationsample/generic/UpperBoundGenericPojo.java
+1
-0
ImmutableCollectionProperties.java
...rationsample/immutable/ImmutableCollectionProperties.java
+1
-0
LombokDefaultValueProperties.java
...figurationsample/lombok/LombokDefaultValueProperties.java
+1
-0
LombokDeprecatedProperties.java
...onfigurationsample/lombok/LombokDeprecatedProperties.java
+1
-0
LombokDeprecatedSingleProperty.java
...gurationsample/lombok/LombokDeprecatedSingleProperty.java
+1
-0
ConfigurationPropertiesBindingPostProcessor.java
...operties/ConfigurationPropertiesBindingPostProcessor.java
+1
-1
RSocketStrategiesCustomizer.java
...k/boot/rsocket/messaging/RSocketStrategiesCustomizer.java
+1
-1
ConfigurableTomcatWebServerFactory.java
...b/embedded/tomcat/ConfigurableTomcatWebServerFactory.java
+1
-0
TomcatReactiveWebServerFactory.java
...t/web/embedded/tomcat/TomcatReactiveWebServerFactory.java
+3
-0
TomcatServletWebServerFactory.java
...ot/web/embedded/tomcat/TomcatServletWebServerFactory.java
+3
-0
CompressionConnectorCustomizerTests.java
.../embedded/tomcat/CompressionConnectorCustomizerTests.java
+2
-2
TomcatReactiveWebServerFactoryTests.java
.../embedded/tomcat/TomcatReactiveWebServerFactoryTests.java
+2
-1
TomcatServletWebServerFactoryTests.java
...b/embedded/tomcat/TomcatServletWebServerFactoryTests.java
+4
-3
DevToolsWithLazyInitializationIntegrationTests.java
...tests/DevToolsWithLazyInitializationIntegrationTests.java
+0
-2
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticSearchClientHealthIndicatorAutoConfiguration.java
View file @
1e44aba7
...
@@ -43,6 +43,8 @@ import org.springframework.context.annotation.Configuration;
...
@@ -43,6 +43,8 @@ import org.springframework.context.annotation.Configuration;
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
* @since 2.1.0
* @since 2.1.0
* @deprecated since 2.2.0 as {@literal org.elasticsearch.client:transport} has been
* deprecated upstream
*/
*/
@Configuration
(
proxyBeanMethods
=
false
)
@Configuration
(
proxyBeanMethods
=
false
)
@ConditionalOnClass
(
Client
.
class
)
@ConditionalOnClass
(
Client
.
class
)
...
@@ -51,6 +53,7 @@ import org.springframework.context.annotation.Configuration;
...
@@ -51,6 +53,7 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureBefore
(
HealthIndicatorAutoConfiguration
.
class
)
@AutoConfigureBefore
(
HealthIndicatorAutoConfiguration
.
class
)
@AutoConfigureAfter
(
ElasticsearchAutoConfiguration
.
class
)
@AutoConfigureAfter
(
ElasticsearchAutoConfiguration
.
class
)
@EnableConfigurationProperties
(
ElasticsearchHealthIndicatorProperties
.
class
)
@EnableConfigurationProperties
(
ElasticsearchHealthIndicatorProperties
.
class
)
@Deprecated
public
class
ElasticSearchClientHealthIndicatorAutoConfiguration
extends
public
class
ElasticSearchClientHealthIndicatorAutoConfiguration
extends
CompositeHealthIndicatorConfiguration
<
ElasticsearchHealthIndicator
,
Client
>
{
CompositeHealthIndicatorConfiguration
<
ElasticsearchHealthIndicator
,
Client
>
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticSearchJestHealthIndicatorAutoConfiguration.java
View file @
1e44aba7
...
@@ -50,6 +50,7 @@ import org.springframework.context.annotation.Configuration;
...
@@ -50,6 +50,7 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureBefore
(
HealthIndicatorAutoConfiguration
.
class
)
@AutoConfigureBefore
(
HealthIndicatorAutoConfiguration
.
class
)
@AutoConfigureAfter
({
JestAutoConfiguration
.
class
,
@AutoConfigureAfter
({
JestAutoConfiguration
.
class
,
ElasticSearchClientHealthIndicatorAutoConfiguration
.
class
})
ElasticSearchClientHealthIndicatorAutoConfiguration
.
class
})
@Deprecated
public
class
ElasticSearchJestHealthIndicatorAutoConfiguration
extends
public
class
ElasticSearchJestHealthIndicatorAutoConfiguration
extends
CompositeHealthIndicatorConfiguration
<
ElasticsearchJestHealthIndicator
,
JestClient
>
{
CompositeHealthIndicatorConfiguration
<
ElasticsearchJestHealthIndicator
,
JestClient
>
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticSearchRestHealthIndicatorAutoConfiguration.java
View file @
1e44aba7
...
@@ -50,6 +50,7 @@ import org.springframework.context.annotation.Configuration;
...
@@ -50,6 +50,7 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureBefore
(
HealthIndicatorAutoConfiguration
.
class
)
@AutoConfigureBefore
(
HealthIndicatorAutoConfiguration
.
class
)
@AutoConfigureAfter
({
RestClientAutoConfiguration
.
class
,
@AutoConfigureAfter
({
RestClientAutoConfiguration
.
class
,
ElasticSearchClientHealthIndicatorAutoConfiguration
.
class
})
ElasticSearchClientHealthIndicatorAutoConfiguration
.
class
})
@SuppressWarnings
(
"deprecation"
)
public
class
ElasticSearchRestHealthIndicatorAutoConfiguration
extends
public
class
ElasticSearchRestHealthIndicatorAutoConfiguration
extends
CompositeHealthIndicatorConfiguration
<
ElasticsearchRestHealthIndicator
,
RestClient
>
{
CompositeHealthIndicatorConfiguration
<
ElasticsearchRestHealthIndicator
,
RestClient
>
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchHealthIndicatorProperties.java
View file @
1e44aba7
...
@@ -22,6 +22,7 @@ import java.util.List;
...
@@ -22,6 +22,7 @@ import java.util.List;
import
org.springframework.boot.actuate.elasticsearch.ElasticsearchHealthIndicator
;
import
org.springframework.boot.actuate.elasticsearch.ElasticsearchHealthIndicator
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.DeprecatedConfigurationProperty
;
/**
/**
* External configuration properties for {@link ElasticsearchHealthIndicator}.
* External configuration properties for {@link ElasticsearchHealthIndicator}.
...
@@ -29,9 +30,12 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -29,9 +30,12 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @author Binwei Yang
* @author Binwei Yang
* @author Andy Wilkinson
* @author Andy Wilkinson
* @since 2.0.0
* @since 2.0.0
* @deprecated since 2.2.0 as {@literal org.elasticsearch.client:transport} has been
* deprecated upstream
*/
*/
@ConfigurationProperties
(
prefix
=
"management.health.elasticsearch"
,
@ConfigurationProperties
(
prefix
=
"management.health.elasticsearch"
,
ignoreUnknownFields
=
false
)
ignoreUnknownFields
=
false
)
@Deprecated
public
class
ElasticsearchHealthIndicatorProperties
{
public
class
ElasticsearchHealthIndicatorProperties
{
/**
/**
...
@@ -44,6 +48,8 @@ public class ElasticsearchHealthIndicatorProperties {
...
@@ -44,6 +48,8 @@ public class ElasticsearchHealthIndicatorProperties {
*/
*/
private
Duration
responseTimeout
=
Duration
.
ofMillis
(
100
);
private
Duration
responseTimeout
=
Duration
.
ofMillis
(
100
);
@DeprecatedConfigurationProperty
(
reason
=
"Upstream elasticsearch transport is deprected"
)
public
List
<
String
>
getIndices
()
{
public
List
<
String
>
getIndices
()
{
return
this
.
indices
;
return
this
.
indices
;
}
}
...
@@ -52,6 +58,8 @@ public class ElasticsearchHealthIndicatorProperties {
...
@@ -52,6 +58,8 @@ public class ElasticsearchHealthIndicatorProperties {
this
.
indices
=
indices
;
this
.
indices
=
indices
;
}
}
@DeprecatedConfigurationProperty
(
reason
=
"Upstream elasticsearch transport is deprected"
)
public
Duration
getResponseTimeout
()
{
public
Duration
getResponseTimeout
()
{
return
this
.
responseTimeout
;
return
this
.
responseTimeout
;
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchHealthIndicatorAutoConfigurationTests.java
View file @
1e44aba7
...
@@ -36,6 +36,7 @@ import static org.mockito.Mockito.mock;
...
@@ -36,6 +36,7 @@ import static org.mockito.Mockito.mock;
*
*
* @author Phillip Webb
* @author Phillip Webb
*/
*/
@Deprecated
public
class
ElasticsearchHealthIndicatorAutoConfigurationTests
{
public
class
ElasticsearchHealthIndicatorAutoConfigurationTests
{
private
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
()
private
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
()
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java
View file @
1e44aba7
/*
/*
* 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");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -25,7 +25,6 @@ import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtensio
...
@@ -25,7 +25,6 @@ import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtensio
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration
;
import
org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.mongo.MongoReactiveDataAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.mongo.MongoReactiveDataAutoConfiguration
;
...
@@ -35,7 +34,6 @@ import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
...
@@ -35,7 +34,6 @@ import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.solr.SolrRepositoriesAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.solr.SolrRepositoriesAutoConfiguration
;
import
org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration
;
import
org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
;
import
org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
;
import
org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration
;
import
org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration
;
import
org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration
;
import
org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration
;
...
@@ -86,12 +84,14 @@ public class WebEndpointsAutoConfigurationIntegrationTests {
...
@@ -86,12 +84,14 @@ public class WebEndpointsAutoConfigurationIntegrationTests {
MongoDataAutoConfiguration
.
class
,
MongoReactiveAutoConfiguration
.
class
,
MongoDataAutoConfiguration
.
class
,
MongoReactiveAutoConfiguration
.
class
,
MongoReactiveDataAutoConfiguration
.
class
,
MongoReactiveDataAutoConfiguration
.
class
,
RepositoryRestMvcAutoConfiguration
.
class
,
HazelcastAutoConfiguration
.
class
,
RepositoryRestMvcAutoConfiguration
.
class
,
HazelcastAutoConfiguration
.
class
,
ElasticsearchAutoConfiguration
.
class
,
org
.
springframework
.
boot
.
autoconfigure
.
data
.
elasticsearch
.
ElasticsearchAutoConfiguration
.
class
,
ElasticsearchDataAutoConfiguration
.
class
,
JestAutoConfiguration
.
class
,
ElasticsearchDataAutoConfiguration
.
class
,
org
.
springframework
.
boot
.
autoconfigure
.
elasticsearch
.
jest
.
JestAutoConfiguration
.
class
,
SolrRepositoriesAutoConfiguration
.
class
,
SolrAutoConfiguration
.
class
,
SolrRepositoriesAutoConfiguration
.
class
,
SolrAutoConfiguration
.
class
,
RedisAutoConfiguration
.
class
,
RedisRepositoriesAutoConfiguration
.
class
,
RedisAutoConfiguration
.
class
,
RedisRepositoriesAutoConfiguration
.
class
,
MetricsAutoConfiguration
.
class
})
MetricsAutoConfiguration
.
class
})
@SpringBootConfiguration
@SpringBootConfiguration
@SuppressWarnings
(
"deprecation"
)
public
static
class
WebEndpointTestApplication
{
public
static
class
WebEndpointTestApplication
{
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryConfigurerIntegrationTests.java
View file @
1e44aba7
...
@@ -84,7 +84,6 @@ public class MeterRegistryConfigurerIntegrationTests {
...
@@ -84,7 +84,6 @@ public class MeterRegistryConfigurerIntegrationTests {
Logger
logger
=
((
LoggerContext
)
StaticLoggerBinder
.
getSingleton
()
Logger
logger
=
((
LoggerContext
)
StaticLoggerBinder
.
getSingleton
()
.
getLoggerFactory
()).
getLogger
(
"test-logger"
);
.
getLoggerFactory
()).
getLogger
(
"test-logger"
);
logger
.
error
(
"Error."
);
logger
.
error
(
"Error."
);
Map
<
String
,
MeterRegistry
>
registriesByName
=
context
Map
<
String
,
MeterRegistry
>
registriesByName
=
context
.
getBeansOfType
(
MeterRegistry
.
class
);
.
getBeansOfType
(
MeterRegistry
.
class
);
assertThat
(
registriesByName
).
hasSize
(
1
);
assertThat
(
registriesByName
).
hasSize
(
1
);
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchHealthIndicator.java
View file @
1e44aba7
...
@@ -35,7 +35,8 @@ import org.springframework.util.StringUtils;
...
@@ -35,7 +35,8 @@ import org.springframework.util.StringUtils;
* @author Binwei Yang
* @author Binwei Yang
* @author Andy Wilkinson
* @author Andy Wilkinson
* @since 2.0.0
* @since 2.0.0
* @deprecated the transport client support is deprecated in favor of other clients
* @deprecated since 2.2.0 as {@literal org.elasticsearch.client:transport} has been
* deprecated upstream
*/
*/
@Deprecated
@Deprecated
public
class
ElasticsearchHealthIndicator
extends
AbstractHealthIndicator
{
public
class
ElasticsearchHealthIndicator
extends
AbstractHealthIndicator
{
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchHealthIndicatorTests.java
View file @
1e44aba7
...
@@ -49,6 +49,7 @@ import static org.mockito.BDDMockito.given;
...
@@ -49,6 +49,7 @@ import static org.mockito.BDDMockito.given;
*
*
* @author Andy Wilkinson
* @author Andy Wilkinson
*/
*/
@Deprecated
public
class
ElasticsearchHealthIndicatorTests
{
public
class
ElasticsearchHealthIndicatorTests
{
@Mock
@Mock
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/BaseConfiguration.java
View file @
1e44aba7
...
@@ -20,7 +20,6 @@ import java.util.Arrays;
...
@@ -20,7 +20,6 @@ import java.util.Arrays;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
;
import
org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper
;
import
org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper
;
import
org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper
;
import
org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper
;
import
org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes
;
import
org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes
;
...
@@ -28,6 +27,7 @@ import org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoa
...
@@ -28,6 +27,7 @@ import org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoa
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.support.PropertySourcesPlaceholderConfigurer
;
import
org.springframework.core.convert.support.DefaultConversionService
;
import
org.springframework.core.convert.support.DefaultConversionService
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
mock
;
...
@@ -73,8 +73,8 @@ class BaseConfiguration {
...
@@ -73,8 +73,8 @@ class BaseConfiguration {
}
}
@Bean
@Bean
public
Property
PlaceholderConfigurer
property
PlaceholderConfigurer
()
{
public
Property
SourcesPlaceholderConfigurer
propertySources
PlaceholderConfigurer
()
{
return
new
PropertyPlaceholderConfigurer
();
return
new
Property
Sources
PlaceholderConfigurer
();
}
}
}
}
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/AbstractRepositoryConfigurationSourceSupport.java
View file @
1e44aba7
/*
/*
* 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");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -22,6 +22,7 @@ import org.springframework.beans.BeansException;
...
@@ -22,6 +22,7 @@ import org.springframework.beans.BeansException;
import
org.springframework.beans.factory.BeanFactory
;
import
org.springframework.beans.factory.BeanFactory
;
import
org.springframework.beans.factory.BeanFactoryAware
;
import
org.springframework.beans.factory.BeanFactoryAware
;
import
org.springframework.beans.factory.support.BeanDefinitionRegistry
;
import
org.springframework.beans.factory.support.BeanDefinitionRegistry
;
import
org.springframework.beans.factory.support.BeanNameGenerator
;
import
org.springframework.boot.autoconfigure.AutoConfigurationPackages
;
import
org.springframework.boot.autoconfigure.AutoConfigurationPackages
;
import
org.springframework.context.EnvironmentAware
;
import
org.springframework.context.EnvironmentAware
;
import
org.springframework.context.ResourceLoaderAware
;
import
org.springframework.context.ResourceLoaderAware
;
...
@@ -45,7 +46,7 @@ import org.springframework.data.util.Streamable;
...
@@ -45,7 +46,7 @@ import org.springframework.data.util.Streamable;
* @author Oliver Gierke
* @author Oliver Gierke
*/
*/
public
abstract
class
AbstractRepositoryConfigurationSourceSupport
public
abstract
class
AbstractRepositoryConfigurationSourceSupport
implements
BeanFactoryAware
,
ImportBeanDefinitionRegistrar
,
ResourceLoaderAware
,
implements
ImportBeanDefinitionRegistrar
,
BeanFactoryAware
,
ResourceLoaderAware
,
EnvironmentAware
{
EnvironmentAware
{
private
ResourceLoader
resourceLoader
;
private
ResourceLoader
resourceLoader
;
...
@@ -56,30 +57,20 @@ public abstract class AbstractRepositoryConfigurationSourceSupport
...
@@ -56,30 +57,20 @@ public abstract class AbstractRepositoryConfigurationSourceSupport
@Override
@Override
public
void
registerBeanDefinitions
(
AnnotationMetadata
importingClassMetadata
,
public
void
registerBeanDefinitions
(
AnnotationMetadata
importingClassMetadata
,
BeanDefinitionRegistry
registry
)
{
BeanDefinitionRegistry
registry
,
BeanNameGenerator
importBeanNameGenerator
)
{
new
RepositoryConfigurationDelegate
(
getConfigurationSource
(
registry
),
RepositoryConfigurationDelegate
delegate
=
new
RepositoryConfigurationDelegate
(
this
.
resourceLoader
,
this
.
environment
).
registerRepositoriesIn
(
registry
,
getConfigurationSource
(
registry
,
importBeanNameGenerator
),
getRepositoryConfigurationExtension
());
this
.
resourceLoader
,
this
.
environment
);
delegate
.
registerRepositoriesIn
(
registry
,
getRepositoryConfigurationExtension
());
}
}
private
AnnotationRepositoryConfigurationSource
getConfigurationSource
(
private
AnnotationRepositoryConfigurationSource
getConfigurationSource
(
BeanDefinitionRegistry
beanDefinitionRegistry
)
{
BeanDefinitionRegistry
registry
,
BeanNameGenerator
importBeanNameGenerator
)
{
StandardAnnotationMetadata
metadata
=
new
StandardAnnotationMetadata
(
StandardAnnotationMetadata
metadata
=
new
StandardAnnotationMetadata
(
getConfiguration
(),
true
);
getConfiguration
(),
true
);
return
new
AnnotationRepositoryConfigurationSource
(
metadata
,
getAnnotation
(),
return
new
AutoConfiguredAnnotationRepositoryConfigurationSource
(
metadata
,
this
.
resourceLoader
,
this
.
environment
,
beanDefinitionRegistry
)
{
getAnnotation
(),
this
.
resourceLoader
,
this
.
environment
,
registry
,
@Override
importBeanNameGenerator
)
{
public
Streamable
<
String
>
getBasePackages
()
{
return
AbstractRepositoryConfigurationSourceSupport
.
this
.
getBasePackages
();
}
@Override
public
BootstrapMode
getBootstrapMode
()
{
return
AbstractRepositoryConfigurationSourceSupport
.
this
.
getBootstrapMode
();
}
};
};
}
}
...
@@ -129,4 +120,29 @@ public abstract class AbstractRepositoryConfigurationSourceSupport
...
@@ -129,4 +120,29 @@ public abstract class AbstractRepositoryConfigurationSourceSupport
this
.
environment
=
environment
;
this
.
environment
=
environment
;
}
}
/**
* An auto-configured {@link AnnotationRepositoryConfigurationSource}.
*/
private
class
AutoConfiguredAnnotationRepositoryConfigurationSource
extends
AnnotationRepositoryConfigurationSource
{
AutoConfiguredAnnotationRepositoryConfigurationSource
(
AnnotationMetadata
metadata
,
Class
<?
extends
Annotation
>
annotation
,
ResourceLoader
resourceLoader
,
Environment
environment
,
BeanDefinitionRegistry
registry
,
BeanNameGenerator
generator
)
{
super
(
metadata
,
annotation
,
resourceLoader
,
environment
,
registry
,
generator
);
}
@Override
public
Streamable
<
String
>
getBasePackages
()
{
return
AbstractRepositoryConfigurationSourceSupport
.
this
.
getBasePackages
();
}
@Override
public
BootstrapMode
getBootstrapMode
()
{
return
AbstractRepositoryConfigurationSourceSupport
.
this
.
getBootstrapMode
();
}
}
}
}
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveRepositoriesAutoConfiguration.java
View file @
1e44aba7
...
@@ -42,7 +42,7 @@ import org.springframework.data.cassandra.repository.support.ReactiveCassandraRe
...
@@ -42,7 +42,7 @@ import org.springframework.data.cassandra.repository.support.ReactiveCassandraRe
@ConditionalOnClass
({
ReactiveSession
.
class
,
ReactiveCassandraRepository
.
class
})
@ConditionalOnClass
({
ReactiveSession
.
class
,
ReactiveCassandraRepository
.
class
})
@ConditionalOnRepositoryType
(
store
=
"cassandra"
,
type
=
RepositoryType
.
REACTIVE
)
@ConditionalOnRepositoryType
(
store
=
"cassandra"
,
type
=
RepositoryType
.
REACTIVE
)
@ConditionalOnMissingBean
(
ReactiveCassandraRepositoryFactoryBean
.
class
)
@ConditionalOnMissingBean
(
ReactiveCassandraRepositoryFactoryBean
.
class
)
@Import
(
CassandraReactiveRepositories
AutoConfigure
Registrar
.
class
)
@Import
(
CassandraReactiveRepositoriesRegistrar
.
class
)
@AutoConfigureAfter
(
CassandraReactiveDataAutoConfiguration
.
class
)
@AutoConfigureAfter
(
CassandraReactiveDataAutoConfiguration
.
class
)
public
class
CassandraReactiveRepositoriesAutoConfiguration
{
public
class
CassandraReactiveRepositoriesAutoConfiguration
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveRepositories
AutoConfigure
Registrar.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveRepositoriesRegistrar.java
View file @
1e44aba7
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -31,7 +31,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
...
@@ -31,7 +31,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
* @author Eddú Meléndez
* @author Eddú Meléndez
* @since 2.0.0
* @since 2.0.0
*/
*/
class
CassandraReactiveRepositories
AutoConfigure
Registrar
class
CassandraReactiveRepositoriesRegistrar
extends
AbstractRepositoryConfigurationSourceSupport
{
extends
AbstractRepositoryConfigurationSourceSupport
{
@Override
@Override
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesAutoConfiguration.java
View file @
1e44aba7
...
@@ -41,7 +41,7 @@ import org.springframework.data.cassandra.repository.support.CassandraRepository
...
@@ -41,7 +41,7 @@ import org.springframework.data.cassandra.repository.support.CassandraRepository
@ConditionalOnClass
({
Session
.
class
,
CassandraRepository
.
class
})
@ConditionalOnClass
({
Session
.
class
,
CassandraRepository
.
class
})
@ConditionalOnRepositoryType
(
store
=
"cassandra"
,
type
=
RepositoryType
.
IMPERATIVE
)
@ConditionalOnRepositoryType
(
store
=
"cassandra"
,
type
=
RepositoryType
.
IMPERATIVE
)
@ConditionalOnMissingBean
(
CassandraRepositoryFactoryBean
.
class
)
@ConditionalOnMissingBean
(
CassandraRepositoryFactoryBean
.
class
)
@Import
(
CassandraRepositories
AutoConfigure
Registrar
.
class
)
@Import
(
CassandraRepositoriesRegistrar
.
class
)
public
class
CassandraRepositoriesAutoConfiguration
{
public
class
CassandraRepositoriesAutoConfiguration
{
}
}
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositories
AutoConfigure
Registrar.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesRegistrar.java
View file @
1e44aba7
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -31,7 +31,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
...
@@ -31,7 +31,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
* @author Eddú Meléndez
* @author Eddú Meléndez
* @since 1.3.0
* @since 1.3.0
*/
*/
class
CassandraRepositories
AutoConfigure
Registrar
class
CassandraRepositoriesRegistrar
extends
AbstractRepositoryConfigurationSourceSupport
{
extends
AbstractRepositoryConfigurationSourceSupport
{
@Override
@Override
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfiguration.java
View file @
1e44aba7
...
@@ -46,6 +46,7 @@ import org.springframework.data.elasticsearch.repository.config.EnableElasticsea
...
@@ -46,6 +46,7 @@ import org.springframework.data.elasticsearch.repository.config.EnableElasticsea
@Configuration
(
proxyBeanMethods
=
false
)
@Configuration
(
proxyBeanMethods
=
false
)
@ConditionalOnClass
({
Client
.
class
,
ElasticsearchTemplate
.
class
})
@ConditionalOnClass
({
Client
.
class
,
ElasticsearchTemplate
.
class
})
@AutoConfigureAfter
(
ElasticsearchAutoConfiguration
.
class
)
@AutoConfigureAfter
(
ElasticsearchAutoConfiguration
.
class
)
@SuppressWarnings
(
"deprecation"
)
public
class
ElasticsearchDataAutoConfiguration
{
public
class
ElasticsearchDataAutoConfiguration
{
@Bean
@Bean
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesAutoConfiguration.java
View file @
1e44aba7
...
@@ -54,7 +54,7 @@ public class JdbcRepositoriesAutoConfiguration {
...
@@ -54,7 +54,7 @@ public class JdbcRepositoriesAutoConfiguration {
@Configuration
(
proxyBeanMethods
=
false
)
@Configuration
(
proxyBeanMethods
=
false
)
@ConditionalOnMissingBean
(
JdbcRepositoryConfigExtension
.
class
)
@ConditionalOnMissingBean
(
JdbcRepositoryConfigExtension
.
class
)
@Import
(
JdbcRepositories
AutoConfigure
Registrar
.
class
)
@Import
(
JdbcRepositoriesRegistrar
.
class
)
static
class
JdbcRepositoriesConfiguration
{
static
class
JdbcRepositoriesConfiguration
{
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositories
AutoConfigure
Registrar.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesRegistrar.java
View file @
1e44aba7
/*
/*
* 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");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -30,7 +30,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
...
@@ -30,7 +30,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
*
*
* @author Andy Wilkinson
* @author Andy Wilkinson
*/
*/
class
JdbcRepositories
AutoConfigure
Registrar
class
JdbcRepositoriesRegistrar
extends
AbstractRepositoryConfigurationSourceSupport
{
extends
AbstractRepositoryConfigurationSourceSupport
{
@Override
@Override
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositoriesAutoConfiguration.java
View file @
1e44aba7
...
@@ -66,7 +66,7 @@ import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean;
...
@@ -66,7 +66,7 @@ import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean;
JpaRepositoryConfigExtension
.
class
})
JpaRepositoryConfigExtension
.
class
})
@ConditionalOnProperty
(
prefix
=
"spring.data.jpa.repositories"
,
name
=
"enabled"
,
@ConditionalOnProperty
(
prefix
=
"spring.data.jpa.repositories"
,
name
=
"enabled"
,
havingValue
=
"true"
,
matchIfMissing
=
true
)
havingValue
=
"true"
,
matchIfMissing
=
true
)
@Import
(
JpaRepositories
AutoConfigure
Registrar
.
class
)
@Import
(
JpaRepositoriesRegistrar
.
class
)
@AutoConfigureAfter
({
HibernateJpaAutoConfiguration
.
class
,
@AutoConfigureAfter
({
HibernateJpaAutoConfiguration
.
class
,
TaskExecutionAutoConfiguration
.
class
})
TaskExecutionAutoConfiguration
.
class
})
public
class
JpaRepositoriesAutoConfiguration
{
public
class
JpaRepositoriesAutoConfiguration
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositories
AutoConfigure
Registrar.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/jpa/JpaRepositoriesRegistrar.java
View file @
1e44aba7
/*
/*
* 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");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -35,7 +35,7 @@ import org.springframework.util.StringUtils;
...
@@ -35,7 +35,7 @@ import org.springframework.util.StringUtils;
* @author Phillip Webb
* @author Phillip Webb
* @author Dave Syer
* @author Dave Syer
*/
*/
class
JpaRepositories
AutoConfigure
Registrar
class
JpaRepositoriesRegistrar
extends
AbstractRepositoryConfigurationSourceSupport
{
extends
AbstractRepositoryConfigurationSourceSupport
{
private
BootstrapMode
bootstrapMode
=
null
;
private
BootstrapMode
bootstrapMode
=
null
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositoriesAutoConfiguration.java
View file @
1e44aba7
...
@@ -53,7 +53,7 @@ import org.springframework.data.mongodb.repository.support.ReactiveMongoReposito
...
@@ -53,7 +53,7 @@ import org.springframework.data.mongodb.repository.support.ReactiveMongoReposito
@ConditionalOnMissingBean
({
ReactiveMongoRepositoryFactoryBean
.
class
,
@ConditionalOnMissingBean
({
ReactiveMongoRepositoryFactoryBean
.
class
,
ReactiveMongoRepositoryConfigurationExtension
.
class
})
ReactiveMongoRepositoryConfigurationExtension
.
class
})
@ConditionalOnRepositoryType
(
store
=
"mongodb"
,
type
=
RepositoryType
.
REACTIVE
)
@ConditionalOnRepositoryType
(
store
=
"mongodb"
,
type
=
RepositoryType
.
REACTIVE
)
@Import
(
MongoReactiveRepositories
AutoConfigure
Registrar
.
class
)
@Import
(
MongoReactiveRepositoriesRegistrar
.
class
)
@AutoConfigureAfter
(
MongoReactiveDataAutoConfiguration
.
class
)
@AutoConfigureAfter
(
MongoReactiveDataAutoConfiguration
.
class
)
public
class
MongoReactiveRepositoriesAutoConfiguration
{
public
class
MongoReactiveRepositoriesAutoConfiguration
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositories
AutoConfigure
Registrar.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositoriesRegistrar.java
View file @
1e44aba7
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -31,7 +31,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
...
@@ -31,7 +31,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
* @author Mark Paluch
* @author Mark Paluch
* @since 2.0.0
* @since 2.0.0
*/
*/
class
MongoReactiveRepositories
AutoConfigure
Registrar
class
MongoReactiveRepositoriesRegistrar
extends
AbstractRepositoryConfigurationSourceSupport
{
extends
AbstractRepositoryConfigurationSourceSupport
{
@Override
@Override
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesAutoConfiguration.java
View file @
1e44aba7
...
@@ -57,7 +57,7 @@ import org.springframework.data.mongodb.repository.support.MongoRepositoryFactor
...
@@ -57,7 +57,7 @@ import org.springframework.data.mongodb.repository.support.MongoRepositoryFactor
@ConditionalOnMissingBean
({
MongoRepositoryFactoryBean
.
class
,
@ConditionalOnMissingBean
({
MongoRepositoryFactoryBean
.
class
,
MongoRepositoryConfigurationExtension
.
class
})
MongoRepositoryConfigurationExtension
.
class
})
@ConditionalOnRepositoryType
(
store
=
"mongodb"
,
type
=
RepositoryType
.
IMPERATIVE
)
@ConditionalOnRepositoryType
(
store
=
"mongodb"
,
type
=
RepositoryType
.
IMPERATIVE
)
@Import
(
MongoRepositories
AutoConfigure
Registrar
.
class
)
@Import
(
MongoRepositoriesRegistrar
.
class
)
@AutoConfigureAfter
(
MongoDataAutoConfiguration
.
class
)
@AutoConfigureAfter
(
MongoDataAutoConfiguration
.
class
)
public
class
MongoRepositoriesAutoConfiguration
{
public
class
MongoRepositoriesAutoConfiguration
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositories
AutoConfigure
Registrar.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesRegistrar.java
View file @
1e44aba7
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -30,7 +30,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
...
@@ -30,7 +30,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
*
*
* @author Dave Syer
* @author Dave Syer
*/
*/
class
MongoRepositories
AutoConfigure
Registrar
class
MongoRepositoriesRegistrar
extends
AbstractRepositoryConfigurationSourceSupport
{
extends
AbstractRepositoryConfigurationSourceSupport
{
@Override
@Override
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jRepositoriesAutoConfiguration.java
View file @
1e44aba7
...
@@ -54,7 +54,7 @@ import org.springframework.data.neo4j.repository.support.Neo4jRepositoryFactoryB
...
@@ -54,7 +54,7 @@ import org.springframework.data.neo4j.repository.support.Neo4jRepositoryFactoryB
Neo4jRepositoryConfigurationExtension
.
class
})
Neo4jRepositoryConfigurationExtension
.
class
})
@ConditionalOnProperty
(
prefix
=
"spring.data.neo4j.repositories"
,
name
=
"enabled"
,
@ConditionalOnProperty
(
prefix
=
"spring.data.neo4j.repositories"
,
name
=
"enabled"
,
havingValue
=
"true"
,
matchIfMissing
=
true
)
havingValue
=
"true"
,
matchIfMissing
=
true
)
@Import
(
Neo4jRepositories
AutoConfigure
Registrar
.
class
)
@Import
(
Neo4jRepositoriesRegistrar
.
class
)
@AutoConfigureAfter
(
Neo4jDataAutoConfiguration
.
class
)
@AutoConfigureAfter
(
Neo4jDataAutoConfiguration
.
class
)
public
class
Neo4jRepositoriesAutoConfiguration
{
public
class
Neo4jRepositoriesAutoConfiguration
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jRepositories
AutoConfigure
Registrar.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jRepositoriesRegistrar.java
View file @
1e44aba7
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -30,7 +30,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
...
@@ -30,7 +30,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
*
*
* @author Michael Hunger
* @author Michael Hunger
*/
*/
class
Neo4jRepositories
AutoConfigure
Registrar
class
Neo4jRepositoriesRegistrar
extends
AbstractRepositoryConfigurationSourceSupport
{
extends
AbstractRepositoryConfigurationSourceSupport
{
@Override
@Override
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfiguration.java
View file @
1e44aba7
...
@@ -43,7 +43,7 @@ import org.springframework.data.redis.repository.support.RedisRepositoryFactoryB
...
@@ -43,7 +43,7 @@ import org.springframework.data.redis.repository.support.RedisRepositoryFactoryB
@ConditionalOnProperty
(
prefix
=
"spring.data.redis.repositories"
,
name
=
"enabled"
,
@ConditionalOnProperty
(
prefix
=
"spring.data.redis.repositories"
,
name
=
"enabled"
,
havingValue
=
"true"
,
matchIfMissing
=
true
)
havingValue
=
"true"
,
matchIfMissing
=
true
)
@ConditionalOnMissingBean
(
RedisRepositoryFactoryBean
.
class
)
@ConditionalOnMissingBean
(
RedisRepositoryFactoryBean
.
class
)
@Import
(
RedisRepositories
AutoConfigure
Registrar
.
class
)
@Import
(
RedisRepositoriesRegistrar
.
class
)
@AutoConfigureAfter
(
RedisAutoConfiguration
.
class
)
@AutoConfigureAfter
(
RedisAutoConfiguration
.
class
)
public
class
RedisRepositoriesAutoConfiguration
{
public
class
RedisRepositoriesAutoConfiguration
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositories
AutoConfigure
Registrar.java
→
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesRegistrar.java
View file @
1e44aba7
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -31,7 +31,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
...
@@ -31,7 +31,7 @@ import org.springframework.data.repository.config.RepositoryConfigurationExtensi
* @author Eddú Meléndez
* @author Eddú Meléndez
* @since 1.4.0
* @since 1.4.0
*/
*/
class
RedisRepositories
AutoConfigure
Registrar
class
RedisRepositoriesRegistrar
extends
AbstractRepositoryConfigurationSourceSupport
{
extends
AbstractRepositoryConfigurationSourceSupport
{
@Override
@Override
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
1e44aba7
...
@@ -79,11 +79,6 @@ public class ServerProperties {
...
@@ -79,11 +79,6 @@ public class ServerProperties {
@NestedConfigurationProperty
@NestedConfigurationProperty
private
final
ErrorProperties
error
=
new
ErrorProperties
();
private
final
ErrorProperties
error
=
new
ErrorProperties
();
/**
* Whether X-Forwarded-* headers should be applied to the HttpRequest.
*/
private
Boolean
useForwardHeaders
;
/**
/**
* Strategy for handling X-Forwarded-* headers.
* Strategy for handling X-Forwarded-* headers.
*/
*/
...
@@ -139,18 +134,15 @@ public class ServerProperties {
...
@@ -139,18 +134,15 @@ public class ServerProperties {
this
.
address
=
address
;
this
.
address
=
address
;
}
}
@DeprecatedConfigurationProperty
@DeprecatedConfigurationProperty
(
reason
=
"replaced to support additional strategies"
,
replacement
=
"server.forward-headers-strategy"
)
public
Boolean
isUseForwardHeaders
()
{
public
Boolean
isUseForwardHeaders
()
{
return
ForwardHeadersStrategy
.
NATIVE
.
equals
(
this
.
forwardHeadersStrategy
);
return
ForwardHeadersStrategy
.
NATIVE
.
equals
(
this
.
forwardHeadersStrategy
);
}
}
public
void
setUseForwardHeaders
(
Boolean
useForwardHeaders
)
{
public
void
setUseForwardHeaders
(
Boolean
useForwardHeaders
)
{
if
(
useForwardHeaders
!=
null
&&
useForwardHeaders
)
{
this
.
forwardHeadersStrategy
=
Boolean
.
TRUE
.
equals
(
useForwardHeaders
)
this
.
forwardHeadersStrategy
=
ForwardHeadersStrategy
.
NATIVE
;
?
ForwardHeadersStrategy
.
NATIVE
:
ForwardHeadersStrategy
.
NONE
;
}
else
{
this
.
forwardHeadersStrategy
=
ForwardHeadersStrategy
.
NONE
;
}
}
}
public
String
getServerHeader
()
{
public
String
getServerHeader
()
{
...
@@ -1358,6 +1350,9 @@ public class ServerProperties {
...
@@ -1358,6 +1350,9 @@ public class ServerProperties {
}
}
/**
* Strategies for supporting forward headers.
*/
public
enum
ForwardHeadersStrategy
{
public
enum
ForwardHeadersStrategy
{
/**
/**
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java
View file @
1e44aba7
...
@@ -40,6 +40,7 @@ import static org.mockito.Mockito.mock;
...
@@ -40,6 +40,7 @@ import static org.mockito.Mockito.mock;
* @author Phillip Webb
* @author Phillip Webb
* @author Andy Wilkinson
* @author Andy Wilkinson
*/
*/
@Deprecated
public
class
ElasticsearchAutoConfigurationTests
{
public
class
ElasticsearchAutoConfigurationTests
{
@ClassRule
@ClassRule
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java
View file @
1e44aba7
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -36,6 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -36,6 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Phillip Webb
* @author Phillip Webb
* @author Artur Konczak
* @author Artur Konczak
*/
*/
@SuppressWarnings
(
"deprecation"
)
public
class
ElasticsearchDataAutoConfigurationTests
{
public
class
ElasticsearchDataAutoConfigurationTests
{
@ClassRule
@ClassRule
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestAutoConfigurationTests.java
View file @
1e44aba7
...
@@ -48,6 +48,7 @@ import static org.mockito.Mockito.mock;
...
@@ -48,6 +48,7 @@ import static org.mockito.Mockito.mock;
* @author Stephane Nicoll
* @author Stephane Nicoll
* @author Andy Wilkinson
* @author Andy Wilkinson
*/
*/
@Deprecated
public
class
JestAutoConfigurationTests
{
public
class
JestAutoConfigurationTests
{
@ClassRule
@ClassRule
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfigurationTests.java
View file @
1e44aba7
...
@@ -72,8 +72,8 @@ public class RestClientAutoConfigurationTests {
...
@@ -72,8 +72,8 @@ public class RestClientAutoConfigurationTests {
.
run
((
context
)
->
{
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
RestClient
.
class
);
assertThat
(
context
).
hasSingleBean
(
RestClient
.
class
);
RestClient
restClient
=
context
.
getBean
(
RestClient
.
class
);
RestClient
restClient
=
context
.
getBean
(
RestClient
.
class
);
assertThat
(
restClient
)
assertThat
(
restClient
)
.
hasFieldOrPropertyWithValue
(
"pathPrefix"
,
.
hasFieldOrPropertyWithValue
(
"maxRetryTimeoutMillis"
,
42L
);
"/test"
);
});
});
}
}
...
@@ -146,7 +146,7 @@ public class RestClientAutoConfigurationTests {
...
@@ -146,7 +146,7 @@ public class RestClientAutoConfigurationTests {
@Bean
@Bean
public
RestClientBuilderCustomizer
myCustomizer
()
{
public
RestClientBuilderCustomizer
myCustomizer
()
{
return
(
builder
)
->
builder
.
set
MaxRetryTimeoutMillis
(
42
);
return
(
builder
)
->
builder
.
set
PathPrefix
(
"/test"
);
}
}
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoClientFactoryTests.java
View file @
1e44aba7
...
@@ -47,7 +47,7 @@ public class MongoClientFactoryTests {
...
@@ -47,7 +47,7 @@ public class MongoClientFactoryTests {
MongoProperties
properties
=
new
MongoProperties
();
MongoProperties
properties
=
new
MongoProperties
();
properties
.
setPort
(
12345
);
properties
.
setPort
(
12345
);
MongoClient
client
=
createMongoClient
(
properties
);
MongoClient
client
=
createMongoClient
(
properties
);
List
<
ServerAddress
>
allAddresses
=
client
.
getAllAddress
(
);
List
<
ServerAddress
>
allAddresses
=
getAllAddresses
(
client
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"localhost"
,
12345
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"localhost"
,
12345
);
}
}
...
@@ -57,7 +57,7 @@ public class MongoClientFactoryTests {
...
@@ -57,7 +57,7 @@ public class MongoClientFactoryTests {
MongoProperties
properties
=
new
MongoProperties
();
MongoProperties
properties
=
new
MongoProperties
();
properties
.
setHost
(
"mongo.example.com"
);
properties
.
setHost
(
"mongo.example.com"
);
MongoClient
client
=
createMongoClient
(
properties
);
MongoClient
client
=
createMongoClient
(
properties
);
List
<
ServerAddress
>
allAddresses
=
client
.
getAllAddress
(
);
List
<
ServerAddress
>
allAddresses
=
getAllAddresses
(
client
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"mongo.example.com"
,
27017
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"mongo.example.com"
,
27017
);
}
}
...
@@ -68,8 +68,7 @@ public class MongoClientFactoryTests {
...
@@ -68,8 +68,7 @@ public class MongoClientFactoryTests {
properties
.
setUsername
(
"user"
);
properties
.
setUsername
(
"user"
);
properties
.
setPassword
(
"secret"
.
toCharArray
());
properties
.
setPassword
(
"secret"
.
toCharArray
());
MongoClient
client
=
createMongoClient
(
properties
);
MongoClient
client
=
createMongoClient
(
properties
);
assertMongoCredential
(
client
.
getCredentialsList
().
get
(
0
),
"user"
,
"secret"
,
assertMongoCredential
(
getCredentials
(
client
).
get
(
0
),
"user"
,
"secret"
,
"test"
);
"test"
);
}
}
@Test
@Test
...
@@ -79,8 +78,7 @@ public class MongoClientFactoryTests {
...
@@ -79,8 +78,7 @@ public class MongoClientFactoryTests {
properties
.
setUsername
(
"user"
);
properties
.
setUsername
(
"user"
);
properties
.
setPassword
(
"secret"
.
toCharArray
());
properties
.
setPassword
(
"secret"
.
toCharArray
());
MongoClient
client
=
createMongoClient
(
properties
);
MongoClient
client
=
createMongoClient
(
properties
);
assertMongoCredential
(
client
.
getCredentialsList
().
get
(
0
),
"user"
,
"secret"
,
assertMongoCredential
(
getCredentials
(
client
).
get
(
0
),
"user"
,
"secret"
,
"foo"
);
"foo"
);
}
}
@Test
@Test
...
@@ -90,8 +88,7 @@ public class MongoClientFactoryTests {
...
@@ -90,8 +88,7 @@ public class MongoClientFactoryTests {
properties
.
setUsername
(
"user"
);
properties
.
setUsername
(
"user"
);
properties
.
setPassword
(
"secret"
.
toCharArray
());
properties
.
setPassword
(
"secret"
.
toCharArray
());
MongoClient
client
=
createMongoClient
(
properties
);
MongoClient
client
=
createMongoClient
(
properties
);
assertMongoCredential
(
client
.
getCredentialsList
().
get
(
0
),
"user"
,
"secret"
,
assertMongoCredential
(
getCredentials
(
client
).
get
(
0
),
"user"
,
"secret"
,
"foo"
);
"foo"
);
}
}
@Test
@Test
...
@@ -100,11 +97,11 @@ public class MongoClientFactoryTests {
...
@@ -100,11 +97,11 @@ public class MongoClientFactoryTests {
properties
.
setUri
(
"mongodb://user:secret@mongo1.example.com:12345,"
properties
.
setUri
(
"mongodb://user:secret@mongo1.example.com:12345,"
+
"mongo2.example.com:23456/test"
);
+
"mongo2.example.com:23456/test"
);
MongoClient
client
=
createMongoClient
(
properties
);
MongoClient
client
=
createMongoClient
(
properties
);
List
<
ServerAddress
>
allAddresses
=
client
.
getAllAddress
(
);
List
<
ServerAddress
>
allAddresses
=
getAllAddresses
(
client
);
assertThat
(
allAddresses
).
hasSize
(
2
);
assertThat
(
allAddresses
).
hasSize
(
2
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"mongo1.example.com"
,
12345
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"mongo1.example.com"
,
12345
);
assertServerAddress
(
allAddresses
.
get
(
1
),
"mongo2.example.com"
,
23456
);
assertServerAddress
(
allAddresses
.
get
(
1
),
"mongo2.example.com"
,
23456
);
List
<
MongoCredential
>
credentialsList
=
client
.
getCredentialsList
(
);
List
<
MongoCredential
>
credentialsList
=
getCredentials
(
client
);
assertThat
(
credentialsList
).
hasSize
(
1
);
assertThat
(
credentialsList
).
hasSize
(
1
);
assertMongoCredential
(
credentialsList
.
get
(
0
),
"user"
,
"secret"
,
"test"
);
assertMongoCredential
(
credentialsList
.
get
(
0
),
"user"
,
"secret"
,
"test"
);
}
}
...
@@ -115,7 +112,7 @@ public class MongoClientFactoryTests {
...
@@ -115,7 +112,7 @@ public class MongoClientFactoryTests {
properties
.
setUri
(
"mongodb://mongo.example.com:1234/mydb"
);
properties
.
setUri
(
"mongodb://mongo.example.com:1234/mydb"
);
this
.
environment
.
setProperty
(
"local.mongo.port"
,
"4000"
);
this
.
environment
.
setProperty
(
"local.mongo.port"
,
"4000"
);
MongoClient
client
=
createMongoClient
(
properties
,
this
.
environment
);
MongoClient
client
=
createMongoClient
(
properties
,
this
.
environment
);
List
<
ServerAddress
>
allAddresses
=
client
.
getAllAddress
(
);
List
<
ServerAddress
>
allAddresses
=
getAllAddresses
(
client
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"localhost"
,
4000
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"localhost"
,
4000
);
}
}
...
@@ -129,6 +126,20 @@ public class MongoClientFactoryTests {
...
@@ -129,6 +126,20 @@ public class MongoClientFactoryTests {
return
new
MongoClientFactory
(
properties
,
environment
).
createMongoClient
(
null
);
return
new
MongoClientFactory
(
properties
,
environment
).
createMongoClient
(
null
);
}
}
@SuppressWarnings
(
"deprecation"
)
private
List
<
ServerAddress
>
getAllAddresses
(
MongoClient
client
)
{
// At some point we'll probably need to use reflection to find the address but for
// now, we can use the deprecated getAllAddress method.
return
client
.
getAllAddress
();
}
@SuppressWarnings
(
"deprecation"
)
private
List
<
MongoCredential
>
getCredentials
(
MongoClient
client
)
{
// At some point we'll probably need to use reflection to find the credentials but
// for now, we can use the deprecated getCredentialsList method.
return
client
.
getCredentialsList
();
}
private
void
assertServerAddress
(
ServerAddress
serverAddress
,
String
expectedHost
,
private
void
assertServerAddress
(
ServerAddress
serverAddress
,
String
expectedHost
,
int
expectedPort
)
{
int
expectedPort
)
{
assertThat
(
serverAddress
.
getHost
()).
isEqualTo
(
expectedHost
);
assertThat
(
serverAddress
.
getHost
()).
isEqualTo
(
expectedHost
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java
View file @
1e44aba7
...
@@ -118,7 +118,7 @@ public class MongoPropertiesTests {
...
@@ -118,7 +118,7 @@ public class MongoPropertiesTests {
properties
.
setUri
(
"mongodb://mongo1.example.com:12345"
);
properties
.
setUri
(
"mongodb://mongo1.example.com:12345"
);
MongoClient
client
=
new
MongoClientFactory
(
properties
,
null
)
MongoClient
client
=
new
MongoClientFactory
(
properties
,
null
)
.
createMongoClient
(
null
);
.
createMongoClient
(
null
);
List
<
ServerAddress
>
allAddresses
=
client
.
getAllAddress
(
);
List
<
ServerAddress
>
allAddresses
=
getAllAddresses
(
client
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"mongo1.example.com"
,
12345
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"mongo1.example.com"
,
12345
);
}
}
...
@@ -130,7 +130,7 @@ public class MongoPropertiesTests {
...
@@ -130,7 +130,7 @@ public class MongoPropertiesTests {
properties
.
setPort
(
27017
);
properties
.
setPort
(
27017
);
MongoClient
client
=
new
MongoClientFactory
(
properties
,
null
)
MongoClient
client
=
new
MongoClientFactory
(
properties
,
null
)
.
createMongoClient
(
null
);
.
createMongoClient
(
null
);
List
<
ServerAddress
>
allAddresses
=
client
.
getAllAddress
(
);
List
<
ServerAddress
>
allAddresses
=
getAllAddresses
(
client
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"localhost"
,
27017
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"localhost"
,
27017
);
}
}
...
@@ -141,7 +141,7 @@ public class MongoPropertiesTests {
...
@@ -141,7 +141,7 @@ public class MongoPropertiesTests {
properties
.
setUri
(
"mongodb://mongo1.example.com:12345"
);
properties
.
setUri
(
"mongodb://mongo1.example.com:12345"
);
MongoClient
client
=
new
MongoClientFactory
(
properties
,
null
)
MongoClient
client
=
new
MongoClientFactory
(
properties
,
null
)
.
createMongoClient
(
null
);
.
createMongoClient
(
null
);
List
<
ServerAddress
>
allAddresses
=
client
.
getAllAddress
(
);
List
<
ServerAddress
>
allAddresses
=
getAllAddresses
(
client
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"mongo1.example.com"
,
12345
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"mongo1.example.com"
,
12345
);
}
}
...
@@ -151,11 +151,18 @@ public class MongoPropertiesTests {
...
@@ -151,11 +151,18 @@ public class MongoPropertiesTests {
MongoProperties
properties
=
new
MongoProperties
();
MongoProperties
properties
=
new
MongoProperties
();
MongoClient
client
=
new
MongoClientFactory
(
properties
,
null
)
MongoClient
client
=
new
MongoClientFactory
(
properties
,
null
)
.
createMongoClient
(
null
);
.
createMongoClient
(
null
);
List
<
ServerAddress
>
allAddresses
=
client
.
getAllAddress
(
);
List
<
ServerAddress
>
allAddresses
=
getAllAddresses
(
client
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertThat
(
allAddresses
).
hasSize
(
1
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"localhost"
,
27017
);
assertServerAddress
(
allAddresses
.
get
(
0
),
"localhost"
,
27017
);
}
}
@SuppressWarnings
(
"deprecation"
)
private
List
<
ServerAddress
>
getAllAddresses
(
MongoClient
client
)
{
// At some point we'll probably need to use reflection to find the address but for
// now, we can use the deprecated getAllAddress method.
return
client
.
getAllAddress
();
}
@Test
@Test
public
void
canBindAutoIndexCreation
()
{
public
void
canBindAutoIndexCreation
()
{
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
();
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
();
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java
View file @
1e44aba7
...
@@ -107,7 +107,7 @@ public class EmbeddedMongoAutoConfigurationTests {
...
@@ -107,7 +107,7 @@ public class EmbeddedMongoAutoConfigurationTests {
MongoClient
client
=
this
.
context
.
getBean
(
MongoClient
.
class
);
MongoClient
client
=
this
.
context
.
getBean
(
MongoClient
.
class
);
Integer
mongoPort
=
Integer
Integer
mongoPort
=
Integer
.
valueOf
(
this
.
context
.
getEnvironment
().
getProperty
(
"local.mongo.port"
));
.
valueOf
(
this
.
context
.
getEnvironment
().
getProperty
(
"local.mongo.port"
));
assertThat
(
client
.
getAddress
().
getPort
(
)).
isEqualTo
(
mongoPort
);
assertThat
(
getPort
(
client
)).
isEqualTo
(
mongoPort
);
}
}
@Test
@Test
...
@@ -117,7 +117,7 @@ public class EmbeddedMongoAutoConfigurationTests {
...
@@ -117,7 +117,7 @@ public class EmbeddedMongoAutoConfigurationTests {
MongoClient
client
=
this
.
context
.
getBean
(
MongoClient
.
class
);
MongoClient
client
=
this
.
context
.
getBean
(
MongoClient
.
class
);
Integer
mongoPort
=
Integer
Integer
mongoPort
=
Integer
.
valueOf
(
this
.
context
.
getEnvironment
().
getProperty
(
"local.mongo.port"
));
.
valueOf
(
this
.
context
.
getEnvironment
().
getProperty
(
"local.mongo.port"
));
assertThat
(
client
.
getAddress
().
getPort
(
)).
isEqualTo
(
mongoPort
);
assertThat
(
getPort
(
client
)).
isEqualTo
(
mongoPort
);
}
}
@Test
@Test
...
@@ -126,7 +126,7 @@ public class EmbeddedMongoAutoConfigurationTests {
...
@@ -126,7 +126,7 @@ public class EmbeddedMongoAutoConfigurationTests {
MongoClient
client
=
this
.
context
.
getBean
(
MongoClient
.
class
);
MongoClient
client
=
this
.
context
.
getBean
(
MongoClient
.
class
);
Integer
mongoPort
=
Integer
Integer
mongoPort
=
Integer
.
valueOf
(
this
.
context
.
getEnvironment
().
getProperty
(
"local.mongo.port"
));
.
valueOf
(
this
.
context
.
getEnvironment
().
getProperty
(
"local.mongo.port"
));
assertThat
(
client
.
getAddress
().
getPort
(
)).
isEqualTo
(
mongoPort
);
assertThat
(
getPort
(
client
)).
isEqualTo
(
mongoPort
);
}
}
@Test
@Test
...
@@ -237,6 +237,13 @@ public class EmbeddedMongoAutoConfigurationTests {
...
@@ -237,6 +237,13 @@ public class EmbeddedMongoAutoConfigurationTests {
return
File
.
separatorChar
==
'\\'
;
return
File
.
separatorChar
==
'\\'
;
}
}
@SuppressWarnings
(
"deprecation"
)
private
int
getPort
(
MongoClient
client
)
{
// At some point we'll probably need to use reflection to find the address but for
// now, we can use the deprecated getAddress method.
return
client
.
getAddress
().
getPort
();
}
@Configuration
(
proxyBeanMethods
=
false
)
@Configuration
(
proxyBeanMethods
=
false
)
static
class
MongoClientConfiguration
{
static
class
MongoClientConfiguration
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/JpaPropertiesTests.java
View file @
1e44aba7
...
@@ -49,6 +49,8 @@ public class JpaPropertiesTests {
...
@@ -49,6 +49,8 @@ public class JpaPropertiesTests {
.
withUserConfiguration
(
TestConfiguration
.
class
);
.
withUserConfiguration
(
TestConfiguration
.
class
);
@Test
@Test
@Deprecated
@SuppressWarnings
(
"deprecation"
)
public
void
determineDatabaseNoCheckIfDatabaseIsSet
()
{
public
void
determineDatabaseNoCheckIfDatabaseIsSet
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.jpa.database=postgresql"
)
this
.
contextRunner
.
withPropertyValues
(
"spring.jpa.database=postgresql"
)
.
run
(
assertJpaProperties
((
properties
)
->
{
.
run
(
assertJpaProperties
((
properties
)
->
{
...
@@ -65,6 +67,8 @@ public class JpaPropertiesTests {
...
@@ -65,6 +67,8 @@ public class JpaPropertiesTests {
}
}
@Test
@Test
@Deprecated
@SuppressWarnings
(
"deprecation"
)
public
void
determineDatabaseWithKnownUrl
()
{
public
void
determineDatabaseWithKnownUrl
()
{
this
.
contextRunner
.
run
(
assertJpaProperties
((
properties
)
->
{
this
.
contextRunner
.
run
(
assertJpaProperties
((
properties
)
->
{
Database
database
=
properties
Database
database
=
properties
...
@@ -74,6 +78,8 @@ public class JpaPropertiesTests {
...
@@ -74,6 +78,8 @@ public class JpaPropertiesTests {
}
}
@Test
@Test
@Deprecated
@SuppressWarnings
(
"deprecation"
)
public
void
determineDatabaseWithKnownUrlAndUserConfig
()
{
public
void
determineDatabaseWithKnownUrlAndUserConfig
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.jpa.database=mysql"
)
this
.
contextRunner
.
withPropertyValues
(
"spring.jpa.database=mysql"
)
.
run
(
assertJpaProperties
((
properties
)
->
{
.
run
(
assertJpaProperties
((
properties
)
->
{
...
@@ -84,6 +90,8 @@ public class JpaPropertiesTests {
...
@@ -84,6 +90,8 @@ public class JpaPropertiesTests {
}
}
@Test
@Test
@Deprecated
@SuppressWarnings
(
"deprecation"
)
public
void
determineDatabaseWithUnknownUrl
()
{
public
void
determineDatabaseWithUnknownUrl
()
{
this
.
contextRunner
.
run
(
assertJpaProperties
((
properties
)
->
{
this
.
contextRunner
.
run
(
assertJpaProperties
((
properties
)
->
{
Database
database
=
properties
Database
database
=
properties
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfigurationTests.java
View file @
1e44aba7
...
@@ -303,7 +303,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests {
...
@@ -303,7 +303,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests {
static
class
TomcatProtocolHandlerCustomizerConfiguration
{
static
class
TomcatProtocolHandlerCustomizerConfiguration
{
@Bean
@Bean
public
TomcatProtocolHandlerCustomizer
protocolHandlerCustomizer
()
{
public
TomcatProtocolHandlerCustomizer
<?>
protocolHandlerCustomizer
()
{
return
(
protocolHandler
)
->
{
return
(
protocolHandler
)
->
{
};
};
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfigurationTests.java
View file @
1e44aba7
...
@@ -417,7 +417,7 @@ public class ServletWebServerFactoryAutoConfigurationTests {
...
@@ -417,7 +417,7 @@ public class ServletWebServerFactoryAutoConfigurationTests {
static
class
TomcatProtocolHandlerCustomizerConfiguration
{
static
class
TomcatProtocolHandlerCustomizerConfiguration
{
@Bean
@Bean
public
TomcatProtocolHandlerCustomizer
protocolHandlerCustomizer
()
{
public
TomcatProtocolHandlerCustomizer
<?>
protocolHandlerCustomizer
()
{
return
(
protocolHandler
)
->
{
return
(
protocolHandler
)
->
{
};
};
}
}
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java
View file @
1e44aba7
...
@@ -117,6 +117,9 @@ public class JsonTestersAutoConfiguration {
...
@@ -117,6 +117,9 @@ public class JsonTestersAutoConfiguration {
/**
/**
* {@link FactoryBean} used to create JSON Tester instances.
* {@link FactoryBean} used to create JSON Tester instances.
*
* @param <T> the object type
* @param <M> the marshaller type
*/
*/
static
class
JsonTesterFactoryBean
<
T
,
M
>
implements
FactoryBean
<
T
>
{
static
class
JsonTesterFactoryBean
<
T
,
M
>
implements
FactoryBean
<
T
>
{
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java
View file @
1e44aba7
...
@@ -108,7 +108,6 @@ class ImportsContextCustomizer implements ContextCustomizer {
...
@@ -108,7 +108,6 @@ class ImportsContextCustomizer implements ContextCustomizer {
throw
new
IllegalStateException
(
"Could not locate BeanDefinitionRegistry"
);
throw
new
IllegalStateException
(
"Could not locate BeanDefinitionRegistry"
);
}
}
@SuppressWarnings
(
"unchecked"
)
private
BeanDefinition
registerBean
(
BeanDefinitionRegistry
registry
,
private
BeanDefinition
registerBean
(
BeanDefinitionRegistry
registry
,
AnnotatedBeanDefinitionReader
reader
,
String
beanName
,
Class
<?>
type
)
{
AnnotatedBeanDefinitionReader
reader
,
String
beanName
,
Class
<?>
type
)
{
reader
.
registerBean
(
type
,
beanName
);
reader
.
registerBean
(
type
,
beanName
);
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProvider.java
View file @
1e44aba7
/*
/*
* 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");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -54,7 +54,8 @@ public interface ApplicationContextAssertProvider<C extends ApplicationContext>
...
@@ -54,7 +54,8 @@ public interface ApplicationContextAssertProvider<C extends ApplicationContext>
/**
/**
* Return an assert for AspectJ.
* Return an assert for AspectJ.
* @return an AspectJ assert
* @return an AspectJ assert
* @deprecated use standard AssertJ {@code assertThat(context)...} calls instead.
* @deprecated to prevent accidental use. Prefer standard AssertJ
* {@code assertThat(context)...} calls instead.
*/
*/
@Deprecated
@Deprecated
@Override
@Override
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java
View file @
1e44aba7
/*
/*
* 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");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -55,8 +55,8 @@ public final class JsonContent<T> implements AssertProvider<JsonContentAssert> {
...
@@ -55,8 +55,8 @@ public final class JsonContent<T> implements AssertProvider<JsonContentAssert> {
/**
/**
* Use AssertJ's {@link org.assertj.core.api.Assertions#assertThat assertThat}
* Use AssertJ's {@link org.assertj.core.api.Assertions#assertThat assertThat}
* instead.
* instead.
* @deprecated
in favor of AssertJ's {@link org.assertj.core.api.Assertions#assertThat
* @deprecated
to prevent accidental use. Prefer standard AssertJ
*
assertThat}
*
{@code assertThat(context)...} calls instead.
*/
*/
@Override
@Override
@Deprecated
@Deprecated
...
...
spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateContextCustomizerWithFactoryBeanTests.java
View file @
1e44aba7
...
@@ -29,6 +29,8 @@ import org.springframework.context.annotation.Configuration;
...
@@ -29,6 +29,8 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
/**
* Integration tests for {@link TestRestTemplateContextCustomizer} to ensure
* Integration tests for {@link TestRestTemplateContextCustomizer} to ensure
* early-initialization of factory beans doesn't occur.
* early-initialization of factory beans doesn't occur.
...
@@ -47,6 +49,7 @@ public class TestRestTemplateContextCustomizerWithFactoryBeanTests {
...
@@ -47,6 +49,7 @@ public class TestRestTemplateContextCustomizerWithFactoryBeanTests {
@Test
@Test
public
void
test
()
{
public
void
test
()
{
assertThat
(
this
.
restTemplate
).
isNotNull
();
}
}
@Configuration
@Configuration
...
...
spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/scan/SimpleFactoryBean.java
View file @
1e44aba7
...
@@ -21,9 +21,13 @@ import org.springframework.context.ApplicationContext;
...
@@ -21,9 +21,13 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
/**
/**
* A simple factory bean with no generics. Used to test early initialization doesn't
* occur.
*
* @author Madhura Bhave
* @author Madhura Bhave
*/
*/
@Component
@Component
@SuppressWarnings
(
"rawtypes"
)
public
class
SimpleFactoryBean
implements
FactoryBean
{
public
class
SimpleFactoryBean
implements
FactoryBean
{
private
static
boolean
isInitializedEarly
=
false
;
private
static
boolean
isInitializedEarly
=
false
;
...
@@ -40,10 +44,12 @@ public class SimpleFactoryBean implements FactoryBean {
...
@@ -40,10 +44,12 @@ public class SimpleFactoryBean implements FactoryBean {
}
}
}
}
@Override
public
Object
getObject
()
{
public
Object
getObject
()
{
return
new
Object
();
return
new
Object
();
}
}
@Override
public
Class
<?>
getObjectType
()
{
public
Class
<?>
getObjectType
()
{
return
Object
.
class
;
return
Object
.
class
;
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/JavaBeanPropertyDescriptorTests.java
View file @
1e44aba7
...
@@ -24,7 +24,6 @@ import javax.lang.model.element.VariableElement;
...
@@ -24,7 +24,6 @@ import javax.lang.model.element.VariableElement;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.configurationsample.simple.DeprecatedProperties
;
import
org.springframework.boot.configurationsample.simple.DeprecatedSingleProperty
;
import
org.springframework.boot.configurationsample.simple.DeprecatedSingleProperty
;
import
org.springframework.boot.configurationsample.simple.SimpleCollectionProperties
;
import
org.springframework.boot.configurationsample.simple.SimpleCollectionProperties
;
import
org.springframework.boot.configurationsample.simple.SimpleProperties
;
import
org.springframework.boot.configurationsample.simple.SimpleProperties
;
...
@@ -196,14 +195,15 @@ public class JavaBeanPropertyDescriptorTests extends PropertyDescriptorTests {
...
@@ -196,14 +195,15 @@ public class JavaBeanPropertyDescriptorTests extends PropertyDescriptorTests {
@Test
@Test
@SuppressWarnings
(
"deprecation"
)
@SuppressWarnings
(
"deprecation"
)
public
void
javaBeanDeprecatedPropertyOnClass
()
throws
IOException
{
public
void
javaBeanDeprecatedPropertyOnClass
()
throws
IOException
{
process
(
DeprecatedProperties
.
class
,
(
roundEnv
,
metadataEnv
)
->
{
process
(
org
.
springframework
.
boot
.
configurationsample
.
simple
.
DeprecatedProperties
.
class
,
TypeElement
ownerElement
=
roundEnv
(
roundEnv
,
metadataEnv
)
->
{
.
getRootElement
(
DeprecatedProperties
.
class
);
TypeElement
ownerElement
=
roundEnv
.
getRootElement
(
JavaBeanPropertyDescriptor
property
=
createPropertyDescriptor
(
ownerElement
,
org
.
springframework
.
boot
.
configurationsample
.
simple
.
DeprecatedProperties
.
class
);
"name"
);
JavaBeanPropertyDescriptor
property
=
createPropertyDescriptor
(
assertItemMetadata
(
metadataEnv
,
property
).
isProperty
()
ownerElement
,
"name"
);
.
isDeprecatedWithNoInformation
();
assertItemMetadata
(
metadataEnv
,
property
).
isProperty
()
});
.
isDeprecatedWithNoInformation
();
});
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/LombokPropertyDescriptorTests.java
View file @
1e44aba7
...
@@ -25,7 +25,6 @@ import javax.lang.model.element.VariableElement;
...
@@ -25,7 +25,6 @@ import javax.lang.model.element.VariableElement;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.configurationsample.lombok.LombokDefaultValueProperties
;
import
org.springframework.boot.configurationsample.lombok.LombokDefaultValueProperties
;
import
org.springframework.boot.configurationsample.lombok.LombokDeprecatedProperties
;
import
org.springframework.boot.configurationsample.lombok.LombokDeprecatedSingleProperty
;
import
org.springframework.boot.configurationsample.lombok.LombokDeprecatedSingleProperty
;
import
org.springframework.boot.configurationsample.lombok.LombokExplicitProperties
;
import
org.springframework.boot.configurationsample.lombok.LombokExplicitProperties
;
import
org.springframework.boot.configurationsample.lombok.LombokInnerClassProperties
;
import
org.springframework.boot.configurationsample.lombok.LombokInnerClassProperties
;
...
@@ -229,14 +228,15 @@ public class LombokPropertyDescriptorTests extends PropertyDescriptorTests {
...
@@ -229,14 +228,15 @@ public class LombokPropertyDescriptorTests extends PropertyDescriptorTests {
@Test
@Test
@SuppressWarnings
(
"deprecation"
)
@SuppressWarnings
(
"deprecation"
)
public
void
lombokDeprecatedPropertyOnClass
()
throws
IOException
{
public
void
lombokDeprecatedPropertyOnClass
()
throws
IOException
{
process
(
LombokDeprecatedProperties
.
class
,
(
roundEnv
,
metadataEnv
)
->
{
process
(
org
.
springframework
.
boot
.
configurationsample
.
lombok
.
LombokDeprecatedProperties
.
class
,
TypeElement
ownerElement
=
roundEnv
(
roundEnv
,
metadataEnv
)
->
{
.
getRootElement
(
LombokDeprecatedProperties
.
class
);
TypeElement
ownerElement
=
roundEnv
.
getRootElement
(
LombokPropertyDescriptor
property
=
createPropertyDescriptor
(
ownerElement
,
org
.
springframework
.
boot
.
configurationsample
.
lombok
.
LombokDeprecatedProperties
.
class
);
"name"
);
LombokPropertyDescriptor
property
=
createPropertyDescriptor
(
assertItemMetadata
(
metadataEnv
,
property
).
isProperty
()
ownerElement
,
"name"
);
.
isDeprecatedWithNoInformation
();
assertItemMetadata
(
metadataEnv
,
property
).
isProperty
()
});
.
isDeprecatedWithNoInformation
();
});
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/generic/UpperBoundGenericPojo.java
View file @
1e44aba7
...
@@ -23,6 +23,7 @@ import java.util.Map;
...
@@ -23,6 +23,7 @@ import java.util.Map;
* A pojo with a complex generic signature.
* A pojo with a complex generic signature.
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
* @param <T> the generic type
*/
*/
public
class
UpperBoundGenericPojo
<
T
extends
Enum
<
T
>>
{
public
class
UpperBoundGenericPojo
<
T
extends
Enum
<
T
>>
{
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/immutable/ImmutableCollectionProperties.java
View file @
1e44aba7
...
@@ -26,6 +26,7 @@ import org.springframework.boot.configurationsample.DefaultValue;
...
@@ -26,6 +26,7 @@ import org.springframework.boot.configurationsample.DefaultValue;
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
*/
*/
@SuppressWarnings
(
"unused"
)
public
class
ImmutableCollectionProperties
{
public
class
ImmutableCollectionProperties
{
private
final
List
<
String
>
names
;
private
final
List
<
String
>
names
;
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/lombok/LombokDefaultValueProperties.java
View file @
1e44aba7
...
@@ -27,6 +27,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
...
@@ -27,6 +27,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
*/
*/
@Data
@Data
@ConfigurationProperties
(
"default"
)
@ConfigurationProperties
(
"default"
)
@SuppressWarnings
(
"unused"
)
public
class
LombokDefaultValueProperties
{
public
class
LombokDefaultValueProperties
{
private
String
description
=
"my description"
;
private
String
description
=
"my description"
;
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/lombok/LombokDeprecatedProperties.java
View file @
1e44aba7
...
@@ -30,6 +30,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
...
@@ -30,6 +30,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
@Setter
@Setter
@ConfigurationProperties
(
prefix
=
"deprecated"
)
@ConfigurationProperties
(
prefix
=
"deprecated"
)
@Deprecated
@Deprecated
@SuppressWarnings
(
"unused"
)
public
class
LombokDeprecatedProperties
{
public
class
LombokDeprecatedProperties
{
private
String
name
;
private
String
name
;
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/lombok/LombokDeprecatedSingleProperty.java
View file @
1e44aba7
...
@@ -27,6 +27,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
...
@@ -27,6 +27,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
*/
*/
@Data
@Data
@ConfigurationProperties
(
"singledeprecated"
)
@ConfigurationProperties
(
"singledeprecated"
)
@SuppressWarnings
(
"unused"
)
public
class
LombokDeprecatedSingleProperty
{
public
class
LombokDeprecatedSingleProperty
{
@Deprecated
@Deprecated
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java
View file @
1e44aba7
...
@@ -55,7 +55,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
...
@@ -55,7 +55,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
/**
/**
* The bean name of the configuration properties validator.
* The bean name of the configuration properties validator.
* @deprecated s
ee
* @deprecated s
ince 2.2.0 in favor of
* {@link ConfigurationPropertiesBindingPostProcessorRegistrar#VALIDATOR_BEAN_NAME}
* {@link ConfigurationPropertiesBindingPostProcessorRegistrar#VALIDATOR_BEAN_NAME}
*/
*/
@Deprecated
@Deprecated
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/rsocket/messaging/RSocketStrategiesCustomizer.java
View file @
1e44aba7
...
@@ -29,7 +29,7 @@ import org.springframework.messaging.rsocket.RSocketStrategies;
...
@@ -29,7 +29,7 @@ import org.springframework.messaging.rsocket.RSocketStrategies;
public
interface
RSocketStrategiesCustomizer
{
public
interface
RSocketStrategiesCustomizer
{
/**
/**
* Callback to customize a {@link RSocketStrategies
.Builder
} instance.
* Callback to customize a {@link RSocketStrategies
#builder()
} instance.
* @param strategies rSocket codec strategies to customize
* @param strategies rSocket codec strategies to customize
*/
*/
void
customize
(
RSocketStrategies
.
Builder
strategies
);
void
customize
(
RSocketStrategies
.
Builder
strategies
);
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/ConfigurableTomcatWebServerFactory.java
View file @
1e44aba7
...
@@ -72,6 +72,7 @@ public interface ConfigurableTomcatWebServerFactory extends ConfigurableWebServe
...
@@ -72,6 +72,7 @@ public interface ConfigurableTomcatWebServerFactory extends ConfigurableWebServe
* Add {@link TomcatProtocolHandlerCustomizer}s that should be added to the Tomcat
* Add {@link TomcatProtocolHandlerCustomizer}s that should be added to the Tomcat
* {@link Connector}.
* {@link Connector}.
* @param tomcatProtocolHandlerCustomizers the customizers to add
* @param tomcatProtocolHandlerCustomizers the customizers to add
* @since 2.2.0
*/
*/
void
addProtocolHandlerCustomizers
(
void
addProtocolHandlerCustomizers
(
TomcatProtocolHandlerCustomizer
<?>...
tomcatProtocolHandlerCustomizers
);
TomcatProtocolHandlerCustomizer
<?>...
tomcatProtocolHandlerCustomizers
);
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatReactiveWebServerFactory.java
View file @
1e44aba7
...
@@ -292,6 +292,7 @@ public class TomcatReactiveWebServerFactory extends AbstractReactiveWebServerFac
...
@@ -292,6 +292,7 @@ public class TomcatReactiveWebServerFactory extends AbstractReactiveWebServerFac
* Set {@link TomcatProtocolHandlerCustomizer}s that should be applied to the Tomcat
* Set {@link TomcatProtocolHandlerCustomizer}s that should be applied to the Tomcat
* {@link Connector}. Calling this method will replace any existing customizers.
* {@link Connector}. Calling this method will replace any existing customizers.
* @param tomcatProtocolHandlerCustomizers the customizers to set
* @param tomcatProtocolHandlerCustomizers the customizers to set
* @since 2.2.0
*/
*/
public
void
setTomcatProtocolHandlerCustomizers
(
public
void
setTomcatProtocolHandlerCustomizers
(
Collection
<?
extends
TomcatProtocolHandlerCustomizer
<?>>
tomcatProtocolHandlerCustomizers
)
{
Collection
<?
extends
TomcatProtocolHandlerCustomizer
<?>>
tomcatProtocolHandlerCustomizers
)
{
...
@@ -305,6 +306,7 @@ public class TomcatReactiveWebServerFactory extends AbstractReactiveWebServerFac
...
@@ -305,6 +306,7 @@ public class TomcatReactiveWebServerFactory extends AbstractReactiveWebServerFac
* Add {@link TomcatProtocolHandlerCustomizer}s that should be added to the Tomcat
* Add {@link TomcatProtocolHandlerCustomizer}s that should be added to the Tomcat
* {@link Connector}.
* {@link Connector}.
* @param tomcatProtocolHandlerCustomizers the customizers to add
* @param tomcatProtocolHandlerCustomizers the customizers to add
* @since 2.2.0
*/
*/
@Override
@Override
public
void
addProtocolHandlerCustomizers
(
public
void
addProtocolHandlerCustomizers
(
...
@@ -319,6 +321,7 @@ public class TomcatReactiveWebServerFactory extends AbstractReactiveWebServerFac
...
@@ -319,6 +321,7 @@ public class TomcatReactiveWebServerFactory extends AbstractReactiveWebServerFac
* Returns a mutable collection of the {@link TomcatProtocolHandlerCustomizer}s that
* Returns a mutable collection of the {@link TomcatProtocolHandlerCustomizer}s that
* will be applied to the Tomcat {@link Connector}.
* will be applied to the Tomcat {@link Connector}.
* @return the customizers that will be applied
* @return the customizers that will be applied
* @since 2.2.0
*/
*/
public
Collection
<
TomcatProtocolHandlerCustomizer
<?>>
getTomcatProtocolHandlerCustomizers
()
{
public
Collection
<
TomcatProtocolHandlerCustomizer
<?>>
getTomcatProtocolHandlerCustomizers
()
{
return
this
.
tomcatProtocolHandlerCustomizers
;
return
this
.
tomcatProtocolHandlerCustomizers
;
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java
View file @
1e44aba7
...
@@ -636,6 +636,7 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
...
@@ -636,6 +636,7 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
* Set {@link TomcatProtocolHandlerCustomizer}s that should be applied to the Tomcat
* Set {@link TomcatProtocolHandlerCustomizer}s that should be applied to the Tomcat
* {@link Connector}. Calling this method will replace any existing customizers.
* {@link Connector}. Calling this method will replace any existing customizers.
* @param tomcatProtocolHandlerCustomizer the customizers to set
* @param tomcatProtocolHandlerCustomizer the customizers to set
* @since 2.2.0
*/
*/
public
void
setTomcatProtocolHandlerCustomizers
(
public
void
setTomcatProtocolHandlerCustomizers
(
Collection
<?
extends
TomcatProtocolHandlerCustomizer
<?>>
tomcatProtocolHandlerCustomizer
)
{
Collection
<?
extends
TomcatProtocolHandlerCustomizer
<?>>
tomcatProtocolHandlerCustomizer
)
{
...
@@ -649,6 +650,7 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
...
@@ -649,6 +650,7 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
* Add {@link TomcatProtocolHandlerCustomizer}s that should be added to the Tomcat
* Add {@link TomcatProtocolHandlerCustomizer}s that should be added to the Tomcat
* {@link Connector}.
* {@link Connector}.
* @param tomcatProtocolHandlerCustomizers the customizers to add
* @param tomcatProtocolHandlerCustomizers the customizers to add
* @since 2.2.0
*/
*/
@Override
@Override
public
void
addProtocolHandlerCustomizers
(
public
void
addProtocolHandlerCustomizers
(
...
@@ -663,6 +665,7 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
...
@@ -663,6 +665,7 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
* Returns a mutable collection of the {@link TomcatProtocolHandlerCustomizer}s that
* Returns a mutable collection of the {@link TomcatProtocolHandlerCustomizer}s that
* will be applied to the Tomcat {@link Connector}.
* will be applied to the Tomcat {@link Connector}.
* @return the customizers that will be applied
* @return the customizers that will be applied
* @since 2.2.0
*/
*/
public
Collection
<
TomcatProtocolHandlerCustomizer
<?>>
getTomcatProtocolHandlerCustomizers
()
{
public
Collection
<
TomcatProtocolHandlerCustomizer
<?>>
getTomcatProtocolHandlerCustomizers
()
{
return
this
.
tomcatProtocolHandlerCustomizers
;
return
this
.
tomcatProtocolHandlerCustomizers
;
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/CompressionConnectorCustomizerTests.java
View file @
1e44aba7
...
@@ -58,14 +58,14 @@ public class CompressionConnectorCustomizerTests {
...
@@ -58,14 +58,14 @@ public class CompressionConnectorCustomizerTests {
Connector
connector
=
new
Connector
(
"org.apache.coyote.http11.Http11NioProtocol"
);
Connector
connector
=
new
Connector
(
"org.apache.coyote.http11.Http11NioProtocol"
);
connector
.
addUpgradeProtocol
(
new
Http2Protocol
());
connector
.
addUpgradeProtocol
(
new
Http2Protocol
());
compressionConnectorCustomizer
.
customize
(
connector
);
compressionConnectorCustomizer
.
customize
(
connector
);
AbstractHttp11Protocol
abstractHttp11Protocol
=
(
AbstractHttp11Protocol
)
connector
AbstractHttp11Protocol
<?>
abstractHttp11Protocol
=
(
AbstractHttp11Protocol
<?>
)
connector
.
getProtocolHandler
();
.
getProtocolHandler
();
verifyHttp1
(
abstractHttp11Protocol
);
verifyHttp1
(
abstractHttp11Protocol
);
Http2Protocol
http2Protocol
=
(
Http2Protocol
)
connector
.
findUpgradeProtocols
()[
0
];
Http2Protocol
http2Protocol
=
(
Http2Protocol
)
connector
.
findUpgradeProtocols
()[
0
];
verifyHttp2Upgrade
(
http2Protocol
);
verifyHttp2Upgrade
(
http2Protocol
);
}
}
private
void
verifyHttp1
(
AbstractHttp11Protocol
protocol
)
{
private
void
verifyHttp1
(
AbstractHttp11Protocol
<?>
protocol
)
{
compressionOn
(
protocol
.
getCompression
());
compressionOn
(
protocol
.
getCompression
());
minSize
(
protocol
.
getCompressionMinSize
());
minSize
(
protocol
.
getCompressionMinSize
());
mimeType
(
protocol
.
getCompressibleMimeTypes
());
mimeType
(
protocol
.
getCompressibleMimeTypes
());
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatReactiveWebServerFactoryTests.java
View file @
1e44aba7
...
@@ -159,10 +159,11 @@ public class TomcatReactiveWebServerFactoryTests
...
@@ -159,10 +159,11 @@ public class TomcatReactiveWebServerFactoryTests
}
}
@Test
@Test
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
public
void
tomcatProtocolHandlerCustomizersShouldBeInvoked
()
{
public
void
tomcatProtocolHandlerCustomizersShouldBeInvoked
()
{
TomcatReactiveWebServerFactory
factory
=
getFactory
();
TomcatReactiveWebServerFactory
factory
=
getFactory
();
HttpHandler
handler
=
mock
(
HttpHandler
.
class
);
HttpHandler
handler
=
mock
(
HttpHandler
.
class
);
TomcatProtocolHandlerCustomizer
<
AbstractHttp11Protocol
>[]
customizers
=
new
TomcatProtocolHandlerCustomizer
[
4
];
TomcatProtocolHandlerCustomizer
<
AbstractHttp11Protocol
<?>
>[]
customizers
=
new
TomcatProtocolHandlerCustomizer
[
4
];
Arrays
.
setAll
(
customizers
,
(
i
)
->
mock
(
TomcatProtocolHandlerCustomizer
.
class
));
Arrays
.
setAll
(
customizers
,
(
i
)
->
mock
(
TomcatProtocolHandlerCustomizer
.
class
));
factory
.
setTomcatProtocolHandlerCustomizers
(
factory
.
setTomcatProtocolHandlerCustomizers
(
Arrays
.
asList
(
customizers
[
0
],
customizers
[
1
]));
Arrays
.
asList
(
customizers
[
0
],
customizers
[
1
]));
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java
View file @
1e44aba7
...
@@ -201,9 +201,10 @@ public class TomcatServletWebServerFactoryTests
...
@@ -201,9 +201,10 @@ public class TomcatServletWebServerFactoryTests
}
}
@Test
@Test
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
public
void
tomcatProtocolHandlerCustomizersShouldBeInvoked
()
{
public
void
tomcatProtocolHandlerCustomizersShouldBeInvoked
()
{
TomcatServletWebServerFactory
factory
=
getFactory
();
TomcatServletWebServerFactory
factory
=
getFactory
();
TomcatProtocolHandlerCustomizer
<
AbstractHttp11Protocol
>[]
customizers
=
new
TomcatProtocolHandlerCustomizer
[
4
];
TomcatProtocolHandlerCustomizer
<
AbstractHttp11Protocol
<?>
>[]
customizers
=
new
TomcatProtocolHandlerCustomizer
[
4
];
Arrays
.
setAll
(
customizers
,
(
i
)
->
mock
(
TomcatProtocolHandlerCustomizer
.
class
));
Arrays
.
setAll
(
customizers
,
(
i
)
->
mock
(
TomcatProtocolHandlerCustomizer
.
class
));
factory
.
setTomcatProtocolHandlerCustomizers
(
factory
.
setTomcatProtocolHandlerCustomizers
(
Arrays
.
asList
(
customizers
[
0
],
customizers
[
1
]));
Arrays
.
asList
(
customizers
[
0
],
customizers
[
1
]));
...
@@ -218,13 +219,13 @@ public class TomcatServletWebServerFactoryTests
...
@@ -218,13 +219,13 @@ public class TomcatServletWebServerFactoryTests
@Test
@Test
public
void
tomcatProtocolHandlerCanBeCustomized
()
{
public
void
tomcatProtocolHandlerCanBeCustomized
()
{
TomcatServletWebServerFactory
factory
=
getFactory
();
TomcatServletWebServerFactory
factory
=
getFactory
();
TomcatProtocolHandlerCustomizer
<
AbstractHttp11Protocol
>
customizer
=
(
TomcatProtocolHandlerCustomizer
<
AbstractHttp11Protocol
<?>
>
customizer
=
(
protocolHandler
)
->
protocolHandler
.
setProcessorCache
(
250
);
protocolHandler
)
->
protocolHandler
.
setProcessorCache
(
250
);
factory
.
addProtocolHandlerCustomizers
(
customizer
);
factory
.
addProtocolHandlerCustomizers
(
customizer
);
Tomcat
tomcat
=
getTomcat
(
factory
);
Tomcat
tomcat
=
getTomcat
(
factory
);
Connector
connector
=
((
TomcatWebServer
)
this
.
webServer
).
getServiceConnectors
()
Connector
connector
=
((
TomcatWebServer
)
this
.
webServer
).
getServiceConnectors
()
.
get
(
tomcat
.
getService
())[
0
];
.
get
(
tomcat
.
getService
())[
0
];
AbstractHttp11Protocol
protocolHandler
=
(
AbstractHttp11Protocol
)
connector
AbstractHttp11Protocol
<?>
protocolHandler
=
(
AbstractHttp11Protocol
<?>
)
connector
.
getProtocolHandler
();
.
getProtocolHandler
();
assertThat
(
protocolHandler
.
getProcessorCache
()).
isEqualTo
(
250
);
assertThat
(
protocolHandler
.
getProcessorCache
()).
isEqualTo
(
250
);
}
}
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsWithLazyInitializationIntegrationTests.java
View file @
1e44aba7
...
@@ -66,8 +66,6 @@ public class DevToolsWithLazyInitializationIntegrationTests {
...
@@ -66,8 +66,6 @@ public class DevToolsWithLazyInitializationIntegrationTests {
private
final
ApplicationLauncher
applicationLauncher
;
private
final
ApplicationLauncher
applicationLauncher
;
private
String
[]
args
;
@Rule
@Rule
public
JvmLauncher
javaLauncher
=
new
JvmLauncher
();
public
JvmLauncher
javaLauncher
=
new
JvmLauncher
();
...
...
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