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
f3fa20b2
Commit
f3fa20b2
authored
Oct 29, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
ac9c003a
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
281 additions
and
79 deletions
+281
-79
JerseyServerMetricsAutoConfiguration.java
.../metrics/jersey/JerseyServerMetricsAutoConfiguration.java
+3
-5
StepRegistryPropertiesTests.java
...etrics/export/properties/StepRegistryPropertiesTests.java
+1
-0
TomcatMetricsAutoConfigurationTests.java
...trics/web/tomcat/TomcatMetricsAutoConfigurationTests.java
+2
-3
BackgroundPreinitializer.java
...ramework/boot/autoconfigure/BackgroundPreinitializer.java
+1
-1
MongoDataAutoConfiguration.java
.../autoconfigure/data/mongo/MongoDataAutoConfiguration.java
+1
-0
package-info.java
...boot/autoconfigure/diagnostics/analyzer/package-info.java
+21
-0
InfluxDbOkHttpClientBuilderProvider.java
...configure/influx/InfluxDbOkHttpClientBuilderProvider.java
+2
-2
XADataSourceAutoConfiguration.java
...oot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java
+11
-7
MongoReactiveAutoConfigurationTests.java
...oconfigure/mongo/MongoReactiveAutoConfigurationTests.java
+19
-16
ReactiveMongoClientFactoryTests.java
.../autoconfigure/mongo/ReactiveMongoClientFactoryTests.java
+10
-4
WebMvcAutoConfigurationTests.java
...toconfigure/web/servlet/WebMvcAutoConfigurationTests.java
+5
-7
RemoteDevToolsAutoConfiguration.java
...vtools/autoconfigure/RemoteDevToolsAutoConfiguration.java
+8
-5
package-info.java
...rg/springframework/boot/devtools/logger/package-info.java
+20
-0
RemoteClientConfiguration.java
...oot/devtools/remote/client/RemoteClientConfiguration.java
+24
-14
SpringBootMockMvcBuilderCustomizer.java
...igure/web/servlet/SpringBootMockMvcBuilderCustomizer.java
+5
-4
package-info.java
.../java/org/springframework/boot/test/web/package-info.java
+20
-0
package-info.java
...onfigurationprocessor/fieldvalues/javac/package-info.java
+20
-0
package-info.java
...boot/configurationprocessor/fieldvalues/package-info.java
+20
-0
package-info.java
...rk/boot/configurationprocessor/metadata/package-info.java
+20
-0
package-info.java
...ngframework/boot/configurationprocessor/package-info.java
+20
-0
ZipInflaterInputStream.java
...ringframework/boot/loader/jar/ZipInflaterInputStream.java
+0
-4
package-info.java
...ain/java/org/springframework/boot/maven/package-info.java
+20
-0
AbstractReactiveWebServerFactoryTests.java
...eactive/server/AbstractReactiveWebServerFactoryTests.java
+8
-7
package-info.java
...on-processor-tests/src/main/java/sample/package-info.java
+20
-0
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/jersey/JerseyServerMetricsAutoConfiguration.java
View file @
f3fa20b2
...
@@ -78,11 +78,9 @@ public class JerseyServerMetricsAutoConfiguration {
...
@@ -78,11 +78,9 @@ public class JerseyServerMetricsAutoConfiguration {
public
ResourceConfigCustomizer
jerseyServerMetricsResourceConfigCustomizer
(
public
ResourceConfigCustomizer
jerseyServerMetricsResourceConfigCustomizer
(
MeterRegistry
meterRegistry
,
JerseyTagsProvider
tagsProvider
)
{
MeterRegistry
meterRegistry
,
JerseyTagsProvider
tagsProvider
)
{
Server
server
=
this
.
properties
.
getWeb
().
getServer
();
Server
server
=
this
.
properties
.
getWeb
().
getServer
();
return
(
config
)
->
{
return
(
config
)
->
config
.
register
(
new
MetricsApplicationEventListener
(
config
.
register
(
new
MetricsApplicationEventListener
(
meterRegistry
,
meterRegistry
,
tagsProvider
,
server
.
getRequestsMetricName
(),
tagsProvider
,
server
.
getRequestsMetricName
(),
server
.
isAutoTimeRequests
(),
new
AnnotationUtilsAnnotationFinder
()));
server
.
isAutoTimeRequests
(),
new
AnnotationUtilsAnnotationFinder
()));
};
}
}
@Bean
@Bean
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/StepRegistryPropertiesTests.java
View file @
f3fa20b2
...
@@ -28,6 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -28,6 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
*/
public
abstract
class
StepRegistryPropertiesTests
{
public
abstract
class
StepRegistryPropertiesTests
{
@SuppressWarnings
(
"deprecation"
)
protected
void
assertStepRegistryDefaultValues
(
StepRegistryProperties
properties
,
protected
void
assertStepRegistryDefaultValues
(
StepRegistryProperties
properties
,
StepRegistryConfig
config
)
{
StepRegistryConfig
config
)
{
assertThat
(
properties
.
getStep
()).
isEqualTo
(
config
.
step
());
assertThat
(
properties
.
getStep
()).
isEqualTo
(
config
.
step
());
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfigurationTests.java
View file @
f3fa20b2
...
@@ -102,9 +102,8 @@ public class TomcatMetricsAutoConfigurationTests {
...
@@ -102,9 +102,8 @@ public class TomcatMetricsAutoConfigurationTests {
.
withConfiguration
(
.
withConfiguration
(
AutoConfigurations
.
of
(
TomcatMetricsAutoConfiguration
.
class
))
AutoConfigurations
.
of
(
TomcatMetricsAutoConfiguration
.
class
))
.
withUserConfiguration
(
MeterRegistryConfiguration
.
class
)
.
withUserConfiguration
(
MeterRegistryConfiguration
.
class
)
.
run
((
context
)
->
{
.
run
((
context
)
->
assertThat
(
context
)
assertThat
(
context
).
hasSingleBean
(
TomcatMetricsBinder
.
class
);
.
hasSingleBean
(
TomcatMetricsBinder
.
class
));
});
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java
View file @
f3fa20b2
...
@@ -40,7 +40,7 @@ import org.springframework.http.converter.support.AllEncompassingFormHttpMessage
...
@@ -40,7 +40,7 @@ import org.springframework.http.converter.support.AllEncompassingFormHttpMessage
* {@link ApplicationListener} to trigger early initialization in a background thread of
* {@link ApplicationListener} to trigger early initialization in a background thread of
* time consuming tasks.
* time consuming tasks.
* <p>
* <p>
* Set the {@
value
IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAME} system property to
* Set the {@
link #
IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAME} system property to
* {@code true} to disable this mechanism and let such initialization happen in the
* {@code true} to disable this mechanism and let such initialization happen in the
* foreground.
* foreground.
*
*
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.java
View file @
f3fa20b2
...
@@ -168,6 +168,7 @@ public class MongoDataAutoConfiguration {
...
@@ -168,6 +168,7 @@ public class MongoDataAutoConfiguration {
}
}
@Override
@Override
@Deprecated
public
DB
getLegacyDb
()
{
public
DB
getLegacyDb
()
{
return
this
.
mongoDbFactory
.
getLegacyDb
();
return
this
.
mongoDbFactory
.
getLegacyDb
();
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/package-info.java
0 → 100644
View file @
f3fa20b2
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Internal {@link org.springframework.boot.diagnostics.FailureAnalyzer} implementations
* related to auto-configuration.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
diagnostics
.
analyzer
;
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/influx/InfluxDbOkHttpClientBuilderProvider.java
View file @
f3fa20b2
...
@@ -22,8 +22,8 @@ import okhttp3.OkHttpClient;
...
@@ -22,8 +22,8 @@ import okhttp3.OkHttpClient;
import
org.influxdb.InfluxDB
;
import
org.influxdb.InfluxDB
;
/**
/**
* Provide the {@link
OkHttpClient.Builder} to use to customize the auto-configured
* Provide the {@link
okhttp3.OkHttpClient.Builder OkHttpClient.Builder} to use to
* {@link InfluxDB} instance.
*
customize the auto-configured
{@link InfluxDB} instance.
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
* @since 2.1.0
* @since 2.1.0
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java
View file @
f3fa20b2
...
@@ -22,7 +22,7 @@ import javax.transaction.TransactionManager;
...
@@ -22,7 +22,7 @@ import javax.transaction.TransactionManager;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.BeanClassLoaderAware
;
import
org.springframework.beans.factory.BeanClassLoaderAware
;
import
org.springframework.beans.factory.
annotation.Autowired
;
import
org.springframework.beans.factory.
ObjectProvider
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.AutoConfigureBefore
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
...
@@ -61,17 +61,21 @@ import org.springframework.util.StringUtils;
...
@@ -61,17 +61,21 @@ import org.springframework.util.StringUtils;
@ConditionalOnMissingBean
(
DataSource
.
class
)
@ConditionalOnMissingBean
(
DataSource
.
class
)
public
class
XADataSourceAutoConfiguration
implements
BeanClassLoaderAware
{
public
class
XADataSourceAutoConfiguration
implements
BeanClassLoaderAware
{
@Autowired
private
final
XADataSourceWrapper
wrapper
;
private
XADataSourceWrapper
wrapper
;
@Autowired
private
final
DataSourceProperties
properties
;
private
DataSourceProperties
properties
;
@Autowired
(
required
=
false
)
private
final
XADataSource
xaDataSource
;
private
XADataSource
xaDataSource
;
private
ClassLoader
classLoader
;
private
ClassLoader
classLoader
;
public
XADataSourceAutoConfiguration
(
XADataSourceWrapper
wrapper
,
DataSourceProperties
properties
,
ObjectProvider
<
XADataSource
>
xaDataSource
)
{
this
.
wrapper
=
wrapper
;
this
.
properties
=
properties
;
this
.
xaDataSource
=
xaDataSource
.
getIfAvailable
();
}
@Bean
@Bean
public
DataSource
dataSource
()
throws
Exception
{
public
DataSource
dataSource
()
throws
Exception
{
XADataSource
xaDataSource
=
this
.
xaDataSource
;
XADataSource
xaDataSource
=
this
.
xaDataSource
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java
View file @
f3fa20b2
...
@@ -29,8 +29,10 @@ import org.junit.Test;
...
@@ -29,8 +29,10 @@ import org.junit.Test;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
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.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
...
@@ -59,10 +61,8 @@ public class MongoReactiveAutoConfigurationTests {
...
@@ -59,10 +61,8 @@ public class MongoReactiveAutoConfigurationTests {
public
void
optionsAdded
()
{
public
void
optionsAdded
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.data.mongodb.host:localhost"
)
this
.
contextRunner
.
withPropertyValues
(
"spring.data.mongodb.host:localhost"
)
.
withUserConfiguration
(
OptionsConfig
.
class
)
.
withUserConfiguration
(
OptionsConfig
.
class
)
.
run
((
context
)
->
assertThat
(
.
run
((
context
)
->
assertThat
(
getSettings
(
context
).
getSocketSettings
()
context
.
getBean
(
MongoClient
.
class
).
getSettings
()
.
getReadTimeout
(
TimeUnit
.
SECONDS
)).
isEqualTo
(
300
));
.
getSocketSettings
().
getReadTimeout
(
TimeUnit
.
SECONDS
))
.
isEqualTo
(
300
));
}
}
@Test
@Test
...
@@ -70,9 +70,8 @@ public class MongoReactiveAutoConfigurationTests {
...
@@ -70,9 +70,8 @@ public class MongoReactiveAutoConfigurationTests {
this
.
contextRunner
this
.
contextRunner
.
withPropertyValues
(
"spring.data.mongodb.uri:mongodb://localhost/test"
)
.
withPropertyValues
(
"spring.data.mongodb.uri:mongodb://localhost/test"
)
.
withUserConfiguration
(
OptionsConfig
.
class
)
.
withUserConfiguration
(
OptionsConfig
.
class
)
.
run
((
context
)
->
assertThat
(
context
.
getBean
(
MongoClient
.
class
)
.
run
((
context
)
->
assertThat
(
getSettings
(
context
).
getReadPreference
())
.
getSettings
().
getReadPreference
())
.
isEqualTo
(
ReadPreference
.
nearest
()));
.
isEqualTo
(
ReadPreference
.
nearest
()));
}
}
@Test
@Test
...
@@ -81,9 +80,7 @@ public class MongoReactiveAutoConfigurationTests {
...
@@ -81,9 +80,7 @@ public class MongoReactiveAutoConfigurationTests {
.
withPropertyValues
(
"spring.data.mongodb.uri:mongodb://localhost/test"
)
.
withPropertyValues
(
"spring.data.mongodb.uri:mongodb://localhost/test"
)
.
withUserConfiguration
(
SslOptionsConfig
.
class
).
run
((
context
)
->
{
.
withUserConfiguration
(
SslOptionsConfig
.
class
).
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
MongoClient
mongo
=
context
.
getBean
(
MongoClient
.
class
);
MongoClientSettings
settings
=
getSettings
(
context
);
com
.
mongodb
.
async
.
client
.
MongoClientSettings
settings
=
mongo
.
getSettings
();
assertThat
(
settings
.
getApplicationName
()).
isEqualTo
(
"test-config"
);
assertThat
(
settings
.
getApplicationName
()).
isEqualTo
(
"test-config"
);
assertThat
(
settings
.
getStreamFactoryFactory
())
assertThat
(
settings
.
getStreamFactoryFactory
())
.
isSameAs
(
context
.
getBean
(
"myStreamFactoryFactory"
));
.
isSameAs
(
context
.
getBean
(
"myStreamFactoryFactory"
));
...
@@ -94,9 +91,8 @@ public class MongoReactiveAutoConfigurationTests {
...
@@ -94,9 +91,8 @@ public class MongoReactiveAutoConfigurationTests {
public
void
nettyStreamFactoryFactoryIsConfiguredAutomatically
()
{
public
void
nettyStreamFactoryFactoryIsConfiguredAutomatically
()
{
this
.
contextRunner
.
run
((
context
)
->
{
this
.
contextRunner
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
assertThat
(
context
.
getBean
(
MongoClient
.
class
).
getSettings
()
assertThat
(
getSettings
(
context
).
getStreamFactoryFactory
())
.
getStreamFactoryFactory
())
.
isInstanceOf
(
NettyStreamFactoryFactory
.
class
);
.
isInstanceOf
(
NettyStreamFactoryFactory
.
class
);
});
});
}
}
...
@@ -106,14 +102,21 @@ public class MongoReactiveAutoConfigurationTests {
...
@@ -106,14 +102,21 @@ public class MongoReactiveAutoConfigurationTests {
"spring.data.mongodb.uri:mongodb://localhost/test?appname=auto-config"
)
"spring.data.mongodb.uri:mongodb://localhost/test?appname=auto-config"
)
.
withUserConfiguration
(
SimpleCustomizerConfig
.
class
).
run
((
context
)
->
{
.
withUserConfiguration
(
SimpleCustomizerConfig
.
class
).
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
assertThat
(
context
).
hasSingleBean
(
MongoClient
.
class
);
MongoClient
client
=
context
.
getBean
(
MongoClient
.
class
);
MongoClient
Settings
settings
=
getSettings
(
context
);
assertThat
(
client
.
getSettings
()
.
getApplicationName
())
assertThat
(
settings
.
getApplicationName
())
.
isEqualTo
(
"overridden-name"
);
.
isEqualTo
(
"overridden-name"
);
assertThat
(
client
.
getSettings
()
.
getStreamFactoryFactory
())
assertThat
(
settings
.
getStreamFactoryFactory
())
.
isEqualTo
(
SimpleCustomizerConfig
.
streamFactoryFactory
);
.
isEqualTo
(
SimpleCustomizerConfig
.
streamFactoryFactory
);
});
});
}
}
@SuppressWarnings
(
"deprecation"
)
private
MongoClientSettings
getSettings
(
ApplicationContext
context
)
{
MongoClient
client
=
context
.
getBean
(
MongoClient
.
class
);
return
(
MongoClientSettings
)
ReflectionTestUtils
.
getField
(
client
.
getSettings
(),
"wrapped"
);
}
@Configuration
@Configuration
static
class
OptionsConfig
{
static
class
OptionsConfig
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/ReactiveMongoClientFactoryTests.java
View file @
f3fa20b2
...
@@ -28,6 +28,7 @@ import org.junit.Test;
...
@@ -28,6 +28,7 @@ import org.junit.Test;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
import
org.springframework.mock.env.MockEnvironment
;
import
org.springframework.mock.env.MockEnvironment
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatIllegalStateException
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatIllegalStateException
;
...
@@ -113,7 +114,7 @@ public class ReactiveMongoClientFactoryTests {
...
@@ -113,7 +114,7 @@ public class ReactiveMongoClientFactoryTests {
MongoProperties
properties
=
new
MongoProperties
();
MongoProperties
properties
=
new
MongoProperties
();
properties
.
setUri
(
"mongodb://localhost/test?retryWrites=true"
);
properties
.
setUri
(
"mongodb://localhost/test?retryWrites=true"
);
MongoClient
client
=
createMongoClient
(
properties
);
MongoClient
client
=
createMongoClient
(
properties
);
assertThat
(
client
.
getSettings
(
).
getRetryWrites
()).
isTrue
();
assertThat
(
getSettings
(
client
).
getRetryWrites
()).
isTrue
();
}
}
@Test
@Test
...
@@ -190,14 +191,19 @@ public class ReactiveMongoClientFactoryTests {
...
@@ -190,14 +191,19 @@ public class ReactiveMongoClientFactoryTests {
}
}
private
List
<
ServerAddress
>
extractServerAddresses
(
MongoClient
client
)
{
private
List
<
ServerAddress
>
extractServerAddresses
(
MongoClient
client
)
{
com
.
mongodb
.
async
.
client
.
MongoClientSettings
settings
=
client
.
getSettings
(
);
MongoClientSettings
settings
=
getSettings
(
client
);
ClusterSettings
clusterSettings
=
settings
.
getClusterSettings
();
ClusterSettings
clusterSettings
=
settings
.
getClusterSettings
();
return
clusterSettings
.
getHosts
();
return
clusterSettings
.
getHosts
();
}
}
private
MongoCredential
extractMongoCredentials
(
MongoClient
client
)
{
private
MongoCredential
extractMongoCredentials
(
MongoClient
client
)
{
com
.
mongodb
.
async
.
client
.
MongoClientSettings
settings
=
client
.
getSettings
();
return
getSettings
(
client
).
getCredential
();
return
settings
.
getCredential
();
}
@SuppressWarnings
(
"deprecation"
)
private
MongoClientSettings
getSettings
(
MongoClient
client
)
{
return
(
MongoClientSettings
)
ReflectionTestUtils
.
getField
(
client
.
getSettings
(),
"wrapped"
);
}
}
private
void
assertServerAddress
(
ServerAddress
serverAddress
,
String
expectedHost
,
private
void
assertServerAddress
(
ServerAddress
serverAddress
,
String
expectedHost
,
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java
View file @
f3fa20b2
...
@@ -512,13 +512,11 @@ public class WebMvcAutoConfigurationTests {
...
@@ -512,13 +512,11 @@ public class WebMvcAutoConfigurationTests {
this
.
contextRunner
.
withUserConfiguration
(
CustomAsyncTaskExecutorConfigurer
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
CustomAsyncTaskExecutorConfigurer
.
class
)
.
withConfiguration
(
.
withConfiguration
(
AutoConfigurations
.
of
(
TaskExecutionAutoConfiguration
.
class
))
AutoConfigurations
.
of
(
TaskExecutionAutoConfiguration
.
class
))
.
run
((
context
)
->
{
.
run
((
context
)
->
assertThat
(
ReflectionTestUtils
.
getField
(
assertThat
(
ReflectionTestUtils
.
getField
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
),
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
),
"taskExecutor"
))
"taskExecutor"
))
.
isSameAs
(
context
.
getBean
(
.
isSameAs
(
context
.
getBean
(
CustomAsyncTaskExecutorConfigurer
.
class
).
taskExecutor
));
CustomAsyncTaskExecutorConfigurer
.
class
).
taskExecutor
);
});
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java
View file @
f3fa20b2
...
@@ -23,7 +23,6 @@ import javax.servlet.Filter;
...
@@ -23,7 +23,6 @@ import javax.servlet.Filter;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
...
@@ -108,11 +107,15 @@ public class RemoteDevToolsAutoConfiguration {
...
@@ -108,11 +107,15 @@ public class RemoteDevToolsAutoConfiguration {
@ConditionalOnProperty
(
prefix
=
"spring.devtools.remote.restart"
,
name
=
"enabled"
,
matchIfMissing
=
true
)
@ConditionalOnProperty
(
prefix
=
"spring.devtools.remote.restart"
,
name
=
"enabled"
,
matchIfMissing
=
true
)
static
class
RemoteRestartConfiguration
{
static
class
RemoteRestartConfiguration
{
@Autowired
private
final
DevToolsProperties
properties
;
private
DevToolsProperties
properties
;
@Autowired
private
final
ServerProperties
serverProperties
;
private
ServerProperties
serverProperties
;
RemoteRestartConfiguration
(
DevToolsProperties
devToolsProperties
,
ServerProperties
serverProperties
)
{
this
.
properties
=
devToolsProperties
;
this
.
serverProperties
=
serverProperties
;
}
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
...
...
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/logger/package-info.java
0 → 100644
View file @
f3fa20b2
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Devtools specific logging concerns.
*/
package
org
.
springframework
.
boot
.
devtools
.
logger
;
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/RemoteClientConfiguration.java
View file @
f3fa20b2
...
@@ -28,7 +28,7 @@ import org.apache.commons.logging.Log;
...
@@ -28,7 +28,7 @@ import org.apache.commons.logging.Log;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.
annotation.Autowired
;
import
org.springframework.beans.factory.
ObjectProvider
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
...
@@ -75,11 +75,12 @@ public class RemoteClientConfiguration implements InitializingBean {
...
@@ -75,11 +75,12 @@ public class RemoteClientConfiguration implements InitializingBean {
private
final
DevToolsProperties
properties
;
private
final
DevToolsProperties
properties
;
@Value
(
"${remoteUrl}"
)
private
final
String
remoteUrl
;
private
String
remoteUrl
;
public
RemoteClientConfiguration
(
DevToolsProperties
properties
)
{
public
RemoteClientConfiguration
(
DevToolsProperties
properties
,
@Value
(
"${remoteUrl}"
)
String
remoteUrl
)
{
this
.
properties
=
properties
;
this
.
properties
=
properties
;
this
.
remoteUrl
=
remoteUrl
;
}
}
@Bean
@Bean
...
@@ -134,20 +135,25 @@ public class RemoteClientConfiguration implements InitializingBean {
...
@@ -134,20 +135,25 @@ public class RemoteClientConfiguration implements InitializingBean {
static
class
LiveReloadConfiguration
static
class
LiveReloadConfiguration
implements
ApplicationListener
<
ClassPathChangedEvent
>
{
implements
ApplicationListener
<
ClassPathChangedEvent
>
{
@Autowired
private
final
DevToolsProperties
properties
;
private
DevToolsProperties
properties
;
@Autowired
(
required
=
false
)
private
final
LiveReloadServer
liveReloadServer
;
private
LiveReloadServer
liveReloadServer
;
@Autowired
private
final
ClientHttpRequestFactory
clientHttpRequestFactory
;
private
ClientHttpRequestFactory
clientHttpRequestFactory
;
@Value
(
"${remoteUrl}"
)
@Value
(
"${remoteUrl}"
)
private
String
remoteUrl
;
private
String
remoteUrl
;
private
ExecutorService
executor
=
Executors
.
newSingleThreadExecutor
();
private
ExecutorService
executor
=
Executors
.
newSingleThreadExecutor
();
LiveReloadConfiguration
(
DevToolsProperties
properties
,
ObjectProvider
<
LiveReloadServer
>
liveReloadServer
,
ClientHttpRequestFactory
clientHttpRequestFactory
)
{
this
.
properties
=
properties
;
this
.
liveReloadServer
=
liveReloadServer
.
getIfAvailable
();
this
.
clientHttpRequestFactory
=
clientHttpRequestFactory
;
}
@Bean
@Bean
@RestartScope
@RestartScope
@ConditionalOnMissingBean
@ConditionalOnMissingBean
...
@@ -181,11 +187,15 @@ public class RemoteClientConfiguration implements InitializingBean {
...
@@ -181,11 +187,15 @@ public class RemoteClientConfiguration implements InitializingBean {
@ConditionalOnProperty
(
prefix
=
"spring.devtools.remote.restart"
,
name
=
"enabled"
,
matchIfMissing
=
true
)
@ConditionalOnProperty
(
prefix
=
"spring.devtools.remote.restart"
,
name
=
"enabled"
,
matchIfMissing
=
true
)
static
class
RemoteRestartClientConfiguration
{
static
class
RemoteRestartClientConfiguration
{
@Autowired
private
final
DevToolsProperties
properties
;
private
DevToolsProperties
properties
;
@Value
(
"${remoteUrl}"
)
private
final
String
remoteUrl
;
private
String
remoteUrl
;
RemoteRestartClientConfiguration
(
DevToolsProperties
properties
,
@Value
(
"${remoteUrl}"
)
String
remoteUrl
)
{
this
.
properties
=
properties
;
this
.
remoteUrl
=
remoteUrl
;
}
@Bean
@Bean
public
ClassPathFileSystemWatcher
classPathFileSystemWatcher
()
{
public
ClassPathFileSystemWatcher
classPathFileSystemWatcher
()
{
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java
View file @
f3fa20b2
...
@@ -111,12 +111,13 @@ public class SpringBootMockMvcBuilderCustomizer implements MockMvcBuilderCustomi
...
@@ -111,12 +111,13 @@ public class SpringBootMockMvcBuilderCustomizer implements MockMvcBuilderCustomi
FilterRegistrationBeans
registrations
=
new
FilterRegistrationBeans
(
this
.
context
);
FilterRegistrationBeans
registrations
=
new
FilterRegistrationBeans
(
this
.
context
);
registrations
.
stream
().
map
(
AbstractFilterRegistrationBean
.
class
::
cast
)
registrations
.
stream
().
map
(
AbstractFilterRegistrationBean
.
class
::
cast
)
.
filter
(
AbstractFilterRegistrationBean:
:
isEnabled
)
.
filter
(
AbstractFilterRegistrationBean:
:
isEnabled
)
.
forEach
((
registration
)
->
addFilter
(
builder
,
registration
.
getFilter
(),
.
forEach
((
registration
)
->
addFilter
(
builder
,
registration
));
registration
.
getUrlPatterns
()));
}
}
private
void
addFilter
(
ConfigurableMockMvcBuilder
<?>
builder
,
Filter
filter
,
private
void
addFilter
(
ConfigurableMockMvcBuilder
<?>
builder
,
Collection
<
String
>
urls
)
{
AbstractFilterRegistrationBean
<?>
registration
)
{
Filter
filter
=
registration
.
getFilter
();
Collection
<
String
>
urls
=
registration
.
getUrlPatterns
();
if
(
urls
.
isEmpty
())
{
if
(
urls
.
isEmpty
())
{
builder
.
addFilters
(
filter
);
builder
.
addFilters
(
filter
);
}
}
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/package-info.java
0 → 100644
View file @
f3fa20b2
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Web test utilities and support classes.
*/
package
org
.
springframework
.
boot
.
test
.
web
;
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/package-info.java
0 → 100644
View file @
f3fa20b2
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Field value parsing for the standard Java compiler.
*/
package
org
.
springframework
.
boot
.
configurationprocessor
.
fieldvalues
.
javac
;
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/package-info.java
0 → 100644
View file @
f3fa20b2
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Abstraction for field value parsing.
*/
package
org
.
springframework
.
boot
.
configurationprocessor
.
fieldvalues
;
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/package-info.java
0 → 100644
View file @
f3fa20b2
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* The configuration properties meta-data model and JSON writing support.
*/
package
org
.
springframework
.
boot
.
configurationprocessor
.
metadata
;
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/package-info.java
0 → 100644
View file @
f3fa20b2
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Annotation processor to create {@code @ConfigurationProperties} meta-data files.
*/
package
org
.
springframework
.
boot
.
configurationprocessor
;
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/ZipInflaterInputStream.java
View file @
f3fa20b2
...
@@ -35,10 +35,6 @@ class ZipInflaterInputStream extends InflaterInputStream {
...
@@ -35,10 +35,6 @@ class ZipInflaterInputStream extends InflaterInputStream {
private
boolean
extraBytesWritten
;
private
boolean
extraBytesWritten
;
ZipInflaterInputStream
(
InputStream
inputStream
,
int
size
)
{
ZipInflaterInputStream
(
InputStream
inputStream
,
int
size
)
{
this
(
inputStream
,
new
Inflater
(
true
),
size
);
}
private
ZipInflaterInputStream
(
InputStream
inputStream
,
Inflater
inflater
,
int
size
)
{
super
(
inputStream
,
new
Inflater
(
true
),
getInflaterBufferSize
(
size
));
super
(
inputStream
,
new
Inflater
(
true
),
getInflaterBufferSize
(
size
));
this
.
available
=
size
;
this
.
available
=
size
;
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/package-info.java
0 → 100644
View file @
f3fa20b2
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Maven plugin for Spring Boot.
*/
package
org
.
springframework
.
boot
.
maven
;
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java
View file @
f3fa20b2
...
@@ -136,7 +136,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
...
@@ -136,7 +136,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
SslContextBuilder
builder
=
SslContextBuilder
.
forClient
()
SslContextBuilder
builder
=
SslContextBuilder
.
forClient
()
.
sslProvider
(
SslProvider
.
JDK
)
.
sslProvider
(
SslProvider
.
JDK
)
.
trustManager
(
InsecureTrustManagerFactory
.
INSTANCE
);
.
trustManager
(
InsecureTrustManagerFactory
.
INSTANCE
);
HttpClient
client
=
HttpClient
.
create
().
wiretap
()
HttpClient
client
=
HttpClient
.
create
().
wiretap
(
true
)
.
secure
((
sslContextSpec
)
->
sslContextSpec
.
sslContext
(
builder
));
.
secure
((
sslContextSpec
)
->
sslContextSpec
.
sslContext
(
builder
));
return
new
ReactorClientHttpConnector
(
client
);
return
new
ReactorClientHttpConnector
(
client
);
}
}
...
@@ -174,7 +174,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
...
@@ -174,7 +174,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
.
sslProvider
(
SslProvider
.
JDK
)
.
sslProvider
(
SslProvider
.
JDK
)
.
trustManager
(
InsecureTrustManagerFactory
.
INSTANCE
)
.
trustManager
(
InsecureTrustManagerFactory
.
INSTANCE
)
.
keyManager
(
clientKeyManagerFactory
);
.
keyManager
(
clientKeyManagerFactory
);
HttpClient
client
=
HttpClient
.
create
().
wiretap
()
HttpClient
client
=
HttpClient
.
create
().
wiretap
(
true
)
.
secure
((
sslContextSpec
)
->
sslContextSpec
.
sslContext
(
builder
));
.
secure
((
sslContextSpec
)
->
sslContextSpec
.
sslContext
(
builder
));
return
new
ReactorClientHttpConnector
(
client
);
return
new
ReactorClientHttpConnector
(
client
);
}
}
...
@@ -232,7 +232,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
...
@@ -232,7 +232,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
}
}
protected
WebClient
.
Builder
getWebClient
()
{
protected
WebClient
.
Builder
getWebClient
()
{
return
getWebClient
(
HttpClient
.
create
().
wiretap
());
return
getWebClient
(
HttpClient
.
create
().
wiretap
(
true
));
}
}
protected
WebClient
.
Builder
getWebClient
(
HttpClient
client
)
{
protected
WebClient
.
Builder
getWebClient
(
HttpClient
client
)
{
...
@@ -304,10 +304,11 @@ public abstract class AbstractReactiveWebServerFactoryTests {
...
@@ -304,10 +304,11 @@ public abstract class AbstractReactiveWebServerFactoryTests {
.
getWebServer
(
new
CharsHandler
(
3000
,
MediaType
.
TEXT_PLAIN
));
.
getWebServer
(
new
CharsHandler
(
3000
,
MediaType
.
TEXT_PLAIN
));
this
.
webServer
.
start
();
this
.
webServer
.
start
();
HttpClient
client
=
HttpClient
.
create
().
wiretap
().
compress
(
true
).
tcpConfiguration
(
HttpClient
client
=
HttpClient
.
create
().
wiretap
(
true
).
compress
(
true
)
(
tcpClient
)
->
tcpClient
.
doOnConnected
((
connection
)
->
connection
.
tcpConfiguration
((
tcpClient
)
->
tcpClient
.
doOnConnected
(
.
channel
().
pipeline
().
addBefore
(
NettyPipeline
.
HttpDecompressor
,
(
connection
)
->
connection
.
channel
().
pipeline
().
addBefore
(
"CompressionTest"
,
new
CompressionDetectionHandler
())));
NettyPipeline
.
HttpDecompressor
,
"CompressionTest"
,
new
CompressionDetectionHandler
())));
return
getWebClient
(
client
).
build
();
return
getWebClient
(
client
).
build
();
}
}
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/src/main/java/sample/package-info.java
0 → 100644
View file @
f3fa20b2
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Sample used for testing.
*/
package
sample
;
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